homepage Welcome to WebmasterWorld Guest from 54.211.157.103
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Trying to append hidden fields with JS
wnat to take info from JS to a CGI when page is called
stcrim




msg:1491454
 8:58 pm on Oct 27, 2002 (gmt 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>

 

txbakers




msg:1491455
 10:01 pm on Oct 27, 2002 (gmt 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.

stcrim




msg:1491456
 11:58 pm on Oct 27, 2002 (gmt 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-

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved