Welcome to WebmasterWorld Guest from 54.146.217.179

Forum Moderators: open

Message Too Old, No Replies

Trying to append hidden fields with JS

wnat to take info from JS to a CGI when page is called

     
8:58 pm on Oct 27, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


Is it possible for a java script to append hidden fields to a page that it calls? From the script below I would like to be able to have hidden fields with the name of the dealership, email address and other information. When the script is used to pop-up a page I would like it to append that information to fields in the page it is calling so the info can be used by a CGI script that's on the resulting page

Any thoughts?

-s-

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%">
<SCRIPT language=JavaScript>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);}
//-->
</SCRIPT>

<script language="JavaScript">
<!-- Hide from old browsers
// Created by Doug Popeney (easyjav@easyjavascipt.com)
// JavaScript Made Easy! - [easyjavascript.com...]

function surfto(form) {
var myindex=form.select1.selectedIndex
if (form.select1.options[myindex].value != "0") {
location=form.select1.options[myindex].value;}
}
//-->
</script>
<form name="form1">
<p align="center"><select name="select1" onchange="surfto(this.form)" size="1">
<option selected value="0">Select your model and see what we have
&quot;In Stock&quot;
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/pilot.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Pilot</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/odyssey.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Odyssey</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/accord.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Accord</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/civic.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Civic</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/civic-hybrid.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Civic Hybrid</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/insight.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Insight</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/passport.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
Passport</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/s2000.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
S 2000</option>
<option value="javascript: MM_openBrWindow('http://wwWebmasterWorldebsite.com/a-inquiry/crv.html','','top=10,left=40,width=470,height=490,resizable=yes,scrollbars=no')">Honda
CR-V</option>
</select></p>
</form>
</td>
</tr>
</table>

10:01 pm on Oct 27, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member txbakers is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Sept 1, 2001
posts:4392
votes: 0


Yes, it's very easy to append values to hidden fields.

Create the hidden fields, and on the Submit, have the js populate the fields with the values you need.

11:58 pm on Oct 27, 2002 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 4, 2000
posts:1324
votes: 0


Thank you - the problems is, I'm not real sure how to do that. Any help at getting started would be greatly appreciated...

-s-