943,987 Members | Top Members by Rank

Ad:
Oct 10th, 2006
0

Automatically populate text box with browser info...

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster
NuGG is offline Offline
110 posts
since Feb 2005
Oct 16th, 2006
0

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

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.
Reputation Points: 10
Solved Threads: 1
Junior Poster
NuGG is offline Offline
110 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Select Box populates text field
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Javascript Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC