Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

correct array reference syntax

I am using a js calendar script that populates a text field with a date. When clicking in the field the calendar shows then i choose a date, calendar closes, the date is now in the field. great it works fine.

example- *note, array use[]*
<input type="text" id="example[]" name="example[]" value="" onfocus="if(self.gfPop)gfPop.fPopCalendar(this);return false;">

I want to make this call from a button. when adding the code to a href, the popup shows but nothing happens when selecting a date. I have tried the following scripts will failure.

*html a href and img tag left out*
onclick="if(self.gfPop)gfPop.fPopCalendar(document.this_form.elements['example[]']);return false;"

onclick="if(self.gfPop)gfPop.fPopCalendar(document.this_form.example[]);return false;"

onclick="if(self.gfPop)gfPop.fPopCalendar(this);return false;"
[896 byte] By [cesarcesar] at [2007-11-11 11:52:27]
# 1 Re: correct array reference syntax
Did it error or just not do anything?
Hack at 2007-11-11 23:34:03 >
# 2 Re: correct array reference syntax
does nothing in click
cesarcesar at 2007-11-11 23:35:03 >
# 3 Re: correct array reference syntax
What is it that you need to have happen? Would you be running a query against your backend database based on the selected date?
Hack at 2007-11-11 23:36:13 >