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?

1 of 5 people (20%) answered Yes
Recently 1 of 5 people (20%) answered Yes

Entry

How to pass a javascript variable in to ASP?

Apr 8th, 2008 18:54
ha mo, Matt Chatterley, Thamira Wickramasinghe,


One option here is to add a hidden field to your ASP form (assuming you
are using form submission to relay data to the server), and then to
acquire a reference to that hidden field from JavaScript e.g.
var field = document.getElementById('idOfHiddenField');
Then you can set the value:
field.value = 'bubba';
And even submit the form automatically:
document.getElementById('idOfForm').submit();
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