lmod
08-23-2004, 04:46 AM
I have a script that I need to finish. I want to use JavaScript to detect a users screen resolution then post it back to the server so I can get it in ASP.
This is what I have:
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function resolution() {
colors = window.screen.colorDepth;
document.form.colordepth.value = window.screen.colorDepth;
document.form.width.value = window.screen.width;
document.form.height.value = window.screen.height;
}
//--></script>
</head>
<body OnLoad="resolution()">
<form action="nistemp.asp" name=form>
<input type=text name=width value="width.value">
<input type=text name=height>
<input type=text name=colordepth>
<input type=text name=i value="<%=nis%>">
</form>
<script type='text/javascript'>document.form.submit();</script>
</body>
</HTML>
Now Without the document.form.submit I see the values in the forms but They dont go to the server when I submit because I have no value set for each form.
Problem:
How do I achieve this:
<input type=text name=height value="JS Variable???????">
This is what I have:
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function resolution() {
colors = window.screen.colorDepth;
document.form.colordepth.value = window.screen.colorDepth;
document.form.width.value = window.screen.width;
document.form.height.value = window.screen.height;
}
//--></script>
</head>
<body OnLoad="resolution()">
<form action="nistemp.asp" name=form>
<input type=text name=width value="width.value">
<input type=text name=height>
<input type=text name=colordepth>
<input type=text name=i value="<%=nis%>">
</form>
<script type='text/javascript'>document.form.submit();</script>
</body>
</HTML>
Now Without the document.form.submit I see the values in the forms but They dont go to the server when I submit because I have no value set for each form.
Problem:
How do I achieve this:
<input type=text name=height value="JS Variable???????">