Hi, I was wondering if anyone could help me find the problem in my code. I've managed to find a good JScript Date picker calendar, where a user clicks a button to make the calendar appear, then cooses a date and it is then entered in the textbox beside it.
This all works fine provided I use a specific name for the textbox. But, I want to use a variable for the textbox name.
The Command Button calls a JScript line, then opens a .JS file, now, HOW do I send an ASP variable to be read in the JS file. Here is the code for the textbox and cmdbutton.
*The syntax for code does not work.
<------------------Code Follows------------------->
<INPUT type=text name="<%=strAddress%>" value='<%=Month(Date()) & "/" & Day(Date()) & "/" & Year(Date())%>' onchange="Jscript:cbfloadmefirst('Details_info', strAddress);">
<INPUT id=btn2 type=button value='Calendar' onclick="Jscript:cbfshowcalendar('Details_info', strAddress, 'btn2');event.cancelBubble=true;">
<------------------End Code ---------------------->
The variable I wish to use is strAddress as seen above.
In the OnChange and onClick events, the first called parameter is the Form name, the second is the form object name.
In those three areas, if I enter a string, such as "joe"
the code works. however, the code is inside a loop, therefore, I need a variable name for the textbox name.
What would be the proper syntax or procedure to get this code to work.
I would like to thank you in advance for your assistance and co-operation.
Zycmi
This all works fine provided I use a specific name for the textbox. But, I want to use a variable for the textbox name.
The Command Button calls a JScript line, then opens a .JS file, now, HOW do I send an ASP variable to be read in the JS file. Here is the code for the textbox and cmdbutton.
*The syntax for code does not work.
<------------------Code Follows------------------->
<INPUT type=text name="<%=strAddress%>" value='<%=Month(Date()) & "/" & Day(Date()) & "/" & Year(Date())%>' onchange="Jscript:cbfloadmefirst('Details_info', strAddress);">
<INPUT id=btn2 type=button value='Calendar' onclick="Jscript:cbfshowcalendar('Details_info', strAddress, 'btn2');event.cancelBubble=true;">
<------------------End Code ---------------------->
The variable I wish to use is strAddress as seen above.
In the OnChange and onClick events, the first called parameter is the Form name, the second is the form object name.
In those three areas, if I enter a string, such as "joe"
the code works. however, the code is inside a loop, therefore, I need a variable name for the textbox name.
What would be the proper syntax or procedure to get this code to work.
I would like to thank you in advance for your assistance and co-operation.
Zycmi