Automatically populate text box with browser info...

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Feb 2005
Posts: 92
Reputation: NuGG is an unknown quantity at this point 
Solved Threads: 1
NuGG's Avatar
NuGG NuGG is offline Offline
Junior Poster in Training

Automatically populate text box with browser info...

 
0
  #1
Oct 10th, 2006
I want some information about a browser, to be inserted automatically into a text box when a page loads. However quite how to do this im not sure.

I have made the form and have a JavaScript which does the job, but I want to know how to get the JavaScript to display the information in the text field.

Here is the JavaScript:

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!-- Begin
  2. var xy = navigator.appVersion;
  3. xz = xy.substring(0,4);
  4. document.write("<center><table border=1 cellpadding=0><tr><td>");
  5. document.write("<center><b>", navigator.appName,"</b>");
  6. document.write("</td></tr><tr><td>");
  7. document.write("<center><table border=0 cellpadding=0><tr>");
  8. document.write("<td>Code Name: </td><td><center>");
  9. document.write("<b>", navigator.appCodeName,"</td></tr>");
  10. document.write("<tr><td>Version: </td><td><center>");
  11. document.write("<b>",xz,"</td></tr>");
  12. document.write("<tr><td>Java enabled: </td><td><center><b>");
  13. if (navigator.javaEnabled()) document.write("sure is!</td></tr>");
  14. else document.write("<font color=red>**NO**</font></td></tr>")
  15. document.write("<tr><td>Screen Resolution too high: </td><td><center>");
  16. document.write("<b><font color=red>",screen.width," x ",screen.height,"</font></td></tr>");
  17. document.write("</table></tr></td></table></center>");
  18. // End -->


And heres the basic form:

<form method="POST" action="--WEBBOT-SELF--" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-onSubmit>
<!--webbot bot="SaveResults" u-file="_private/form_results.csv" s-format="TEXT/CSV" s-label-fields="TRUE" startspan --><input TYPE="hidden" NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResults" endspan i-checksum="43374" --><p>
<textarea rows="5" name="S1" cols="33">I WANT THE SCRIPT TO BE DISPLAYED HERE onLoad</textarea></p>
<p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
</form>


I've tried a few things with no success. I think the script may need changing to make this work. Anyone got any ideas?

Cheers,

NuGG
Last edited by NuGG; Oct 10th, 2006 at 1:20 pm.
Pubonwheels - Mobile Bar Services for the South West of England.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 92
Reputation: NuGG is an unknown quantity at this point 
Solved Threads: 1
NuGG's Avatar
NuGG NuGG is offline Offline
Junior Poster in Training

Re: Automatically populate text box with browser info...

 
0
  #2
Oct 16th, 2006
Here is an example if it helps.CLICK HERE! Note that your screen resolution must be above 1024X768 to view the example, otherwise it will just forward you to another page.
Pubonwheels - Mobile Bar Services for the South West of England.
The Kings Head Inn - The Kings Head, Underhill, Coleford, Somerset, UK.
South West Ravers - Going out to all you jungle drum and bass ravers.
UFB Live Radio - Keep It Locked.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC