Click to See Complete Forum and Search --> : Pass a parameter?


TonyV
08-13-2003, 04:37 PM
How do you pass a parameter using javascript to duplicate a button passing values? For example in the following form, the values of ServerAddress and LogOnChoice will be sent in the url with the submit button. How do you send these variables when you use the window.open below.

<FORM ACTION="../cgi-bin/cgiInterNetMath.exe/Manager" METHOD="GET" name="LoggingOn">
<input type=hidden name=ServerAddress value=<#ServerAddress>
<SELECT NAME="LogOnChoice" size="1">
<OPTION SELECTED VALUE="USER">Student
<OPTION VALUE="MANAGER">Manager/Teacher
<OPTION VALUE="GENERALMANAGER">General Manager
</SELECT>
<INPUT TYPE="SUBMIT" VALUE="Subscriber Log On" name="LogOnButton" >



<input name="LogOn" type="SUBMIT" class="ppbuttonsmall" onClick="window.open('/cgi-bin/mathhtm/Managers.htm');" value="Log On">

Thanks for any help.

Khalid Ali
08-13-2003, 05:31 PM
Appedn the values to your url
suppose your varaible name is
name = "Joe" and youwanted this to pass to the url which opens popup

"/cgi-bin/mathhtm/Managers.htm?name=Joe"

will do the trick

TonyV
08-13-2003, 07:48 PM
Your answer assumes I know the value of the variable. The value of the variable is determined by the user's response, in this case a drop down box. I need something on the order of:

onClick="window.open('/cgi-bin/mathhtm/Managers.htm?LogOnChoice=LogOnChoice.value');"

However this won't work.

Khalid Ali
08-14-2003, 01:11 AM
Originally posted by TonyV
....?LogOnChoice=LogOnChoice.value');"



Thats exactly what I said,just diff words.

what you can do is, in onchange events of the list boxes create the url that calls the CGI program that way when user clicks on for opening window,the url is already created.

TonyV
08-14-2003, 05:12 PM
I have been trying to create this but have been unsuccessful. Could you be more specific as to how to do this with this variable when trying to place the changed value of LogOnChoice into? Thanks for any help.

<input name="LogOn" type="SUBMIT" class="ppbuttonsmall" onClick="window.open('/cgi-bin/mathhtm/Managers.htm');" value="Log On">

<FORM ACTION="../cgi-bin/cgiInterNetMath.exe/Manager" METHOD="GET" name="LoggingOn">
<SELECT NAME="LogOnChoice" size="1">
<OPTION SELECTED VALUE="USER">Student
<OPTION VALUE="MANAGER">Manager/Teacher
<OPTION VALUE="GENERALMANAGER">General Manager
</SELECT>
<INPUT TYPE="SUBMIT" VALUE="Subscriber Log On" name="LogOnButton" >