Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Setting\Passing

Status
Not open for further replies.

JavaDude32

Programmer
Aug 25, 2001
180
US
I have a webpage that basically serves as an input page to enter address information by utilizing a simple html form. After having entered the data, then the framed page with the map frame and the toolbar frame is supposed to load in the same window (replacing the input page). How do I pass the form variables to the Map frame of the main page without making the main page an ASP file?

IE
index.html 'Input page
main.html 'Frame page
map.asp 'map file
toolbar.html 'uses javascript to update map
 
maybe some JS:
--------------------------
<script>
function PassVars(){
var var1,var2,var3;
var1 = document.FORM_NAME.elements[6].value;
var2 = document.FORM_NAME.elements[8].value;
var3 = document.FORM_NAME.elements[28].value;
document.FORM_NAME.submit();
};
</script>
...
....
.....
<form name=&quot;FORM_NAME&quot; OnSubmit=&quot;PassVars();>
[]....[]....[]..[]
</form>
--------------------
so var1 will pass the 6th form element(field,box,list...)
you can specify which one you would like to pass!
All the Best!
 
Javascript is more efficient (from a server perspective), so use it if you can. If you can't then turn the main frame into and ASP page (index.asp) and submit the form to it, via the GET method if that's not a problem. In the index.asp page you would simply add the data (by grabbing the entire querystring sent to index.asp or by creating a new querystring &quot;manually&quot; using each item in request.form or request.querystring) to the querystring of map.asp, such that the frame tag for that frame points to &quot;
Code:
main.asp?fname=bob&lname=williams&address=...
&quot;, etc.
 
No offence here to any of you guys but you are loosing me....

JavaDude32:
-How do I pass the form variables to the Map frame of the main page without making the main page an ASP file?
-index.html

Genimuse:
-...turn the main frame into and ASP page-
-..In the index.asp -
------------------------

*IF u can do ASP just go ASP all the way and do what Genimuse said!Why not use ASP pages then?Is there a specific reason for HTML? U can include HTML into ASP if needed for some reason....
well, anyway, I hope you found your answers :)
all the best!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top