View Full Version : Sending a javascipt return value on Post

02-07-2007, 04:42 PM
Hi, its been ages since ive done any javascripting/asp and im a bit stuck as how to do this,

Basically im trying to detect wether the operating system is a windowsCE OS or not and post the value to the next page where i can put it in a session variable.

the script im using is

function checkOS() {
if(navigator.userAgent.indexOf('CE') != -1)
{ var OpSys = "CE"; }
else { var OpSys = "WIN"; }
return OpSys;

and i need some way of posting the returned value on the submit of the form to the next page, along with other values that are in the form.

This is probably real easy...

Any help would be greatly appreciated here.



02-07-2007, 04:51 PM
Create a hidden field, give it a name and an id. Then it's simply document.getElementById('fieldID').value=checkOS(); and access it by name on the server. Also, are Win and WinCE the only OSes you want to deal with?

02-07-2007, 05:03 PM
Yeah Im only bothered if its a CE os really, where do i put the document bit though, this whole things bothering me a bit, ive not done any web development for about 3 years now...