Form Input Arrays

Discussion in 'JavaScript' started by cesarcesar, Jul 12, 2007.

  1. #1
    Im using this Calendar, http://www.calendarxp.net/, on my page. It works great as exampled on the site. My problem comes in when i use the calendar in a form textfield that is an array. I think my *document.this_form.example[]* call is incorrect, but my novice JS knowledge is preventing me from getting it right.

    Please explain how i can get the calendar to work in the following example. The first textfield call works since it is not in an array.

    Thanks much.

    
    <form method="POST" action="example.php" name="this_form">
    	<input type="text" id="example_working" name="example_working" onfocus="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example_working);return false;">
    	<input type="text" id="example[]" name="example[]" onfocus="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example[]);return false;">
    	<input type="text" id="example[]" name="example[]" onfocus="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example[]);return false;">
    	<input type="text" id="example[]" name="example[]" onfocus="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example[]);return false;">
    	<input type="text" id="example[]" name="example[]" onfocus="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example[]);return false;">
    	<input type="text" id="example[]" name="example[]" onfocus="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example[]);return false;">
    </form>
    
    Code (markup):
     
    cesarcesar, Jul 12, 2007 IP
  2. cesarcesar

    cesarcesar Peon

    Messages:
    188
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0