faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 15 people (13%) answered Yes
Recently 0 of 10 people (0%) answered Yes

Entry

can i store array of form variables in javascript and use them in any of the pages i navigate to?

Apr 5th, 2008 20:04
ha mo, Colin Fraser, Muthiah Sivalingam,


I think that it would be fairly simple, but that depends upon how you
want to put them into the array. 
Try this
<form action="newData.htm">
Credit Card: <input type="checkbox" name="box1">
Visa: <input type="radio" name="radio1" value="visa">
AmEx: <input type="radio" name="radio1" value="amex">
<input type="submit">
</form>
Make sure every element is named here, and then in newData.htm, you can
check what has been submitted:
<script language="JavaScript"><!--
var submitted=window.location.search.substring(1);
alert(submitted);
//--></script>
Data, in this example, is sent as a string so you need to manipulate the
string. So placing the data into an array on pressing the Submit button
should be relatively easy. I have found this does not work using IE, and
I dont know why so it may not be any good to you. However, it may get
you started.
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com