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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I use javaScript in ASP? 1

Status
Not open for further replies.

wniatbms

Programmer
Dec 5, 2003
24
0
0
ZA
Good day.

Part of my website has a registration page. I want to include a hidden input field that captures the screen resolution of the visitor and then store that value in my DBase. The javaScript code is as follows:

<script language="javascript">
document.write ((screen.width) + ' by ' + (screen.height))</script>

The problem I'm having is that on screen it will display my resolution 1600x1200 but when I submit the form, it stores the actual javaScript and not the value.

What am I doing wrong?

Many thanks

William.
 
try this:
Code:
<intput type="hidden" name="h1" value="">
<script language="javascript">
document.FormName.h1.value= ((screen.width) + ' by ' + (screen.height))
</script>

Formname is the form's name...

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top