HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 15th, 2003, 04:37 PM
fomkatya fomkatya is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 fomkatya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>

Reply With Quote
  #2  
Old December 3rd, 2003, 03:06 AM
dev257 dev257 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Chandigarh
Posts: 55 dev257 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 48 sec
Reputation Power: 5
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

Reply With Quote
  #3  
Old January 8th, 2004, 01:04 AM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
Screen resolution in Javascript is:
screen.width and screen.height

Browser detection and OS detection found here: http://devedge.netscape.com/viewsou...wser-detection/

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > handling forms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT