|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
|
|
#1
|
|||
|
|||
|
Passing javascript vars to a cgi script
First I get the data from the form on the page via:
$acct_name = document.requests.acct_name.value ; I know that I have the data by testing: alert("Account Name: " + $acct_name) ; So far so good. Now the menu, which is the javascript including the above, submits the following when the menu item is clicked: document.write('<tr>'); document.write('<form action="http://www.somewebpage.com/cgi-bin/requests.cgi" method="post">'); document.write('<td align="left" valign="center">'); document.write('<input type="submit" value="File Requests" class="menulinks1"><br></td>'); document.write('<td><input type="hidden" name="acct_name" value=$acct_name></td>'); . . . document.write('</form></tr>'); The above code is only for one of a number of menu items. Result: The .cgi gets called ok but the name of the field $acct_name is displayed instead of the value. I have tried it value="$acct_name", value='$acct_name', value=$acct_name, and even value=document.requests.acct_name.value --- Everytime I get the field name. The requests.cgi is currently in use and working fine. It is being called by another .cgi which passes the variables via _POST. I have to incorporate this into a new site that is PHP/MySQL, so I just mimic the use of the _POST variables by using the javascript. I can rewrite the whole thing PHP/MySQL, which will probably happen in the future, but I am just trying to use what is already working for now. Any suggestions/observations/etc., are gratefully welcomed. I have combed the javascript resources but can not find anything that helps. I had a previous post here trying to do the same thing with _SESSION vars, but no results yet. Thanks !!! |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > Passing javascript vars to a cgi script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|