|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
handling forms
How can I pass user's browser, OS and resolution information to the form element?
I need to make radiobuttons to be checked by default according to the user's information. For example, if visitor's browser is IE I would like the radiobutton with value="Internet Explorer" to be checked by default. Thanks. Here is the part of the form: <html> <head> <script language="JavaScript"> var browserName = navigator.appName var browserVersion = navigator.appVersion var OS = navigator.userAgent var screenWidth = screen.width var screenHeight = screen.height document.write("Browser: <b>"+ browserName + " ??" + browserVersion + "</b><br>") document.write("OS: <b>" + OS + "</b><br>") document.write("Screen resolution: <b>" + screenWidth + " </b>x<b> " + screenHeight + "</b><br>") </script> </head> <form name="form1" method="post" action=""> <input type="radio" name="browser" value="Internet Explorer">Internet Explorer<br> <input type="radio" name="browser" value="Netscape">Netscape<br> <input type="radio" name="browser" value="Other">Other<br> <hr color="red" width="200" align="left"> <input type="radio" name="OS" value="Win 95">Windows 95<br> <input type="radio" name="OS" value="Win XP">Windows XP<br> <input type="radio" name="OS" value="Win 2000">Windows 2000<br> </form> </html> |
|
#2
|
|||
|
|||
|
step 1. using the indexOf method find if there is MSIE in browserversion the method returns 0 if not found . this was for ie
use like wise |
|
#3
|
||||
|
||||
|
Screen resolution in Javascript is:
screen.width and screen.height Browser detection and OS detection found here: http://devedge.netscape.com/viewsou...wser-detection/ |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > handling forms |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|