Preselection of stored value in an input control of a form

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

Join Date: Sep 2005
Posts: 2
Reputation: FlyBoy767 is an unknown quantity at this point 
Solved Threads: 0
FlyBoy767 FlyBoy767 is offline Offline
Newbie Poster

Preselection of stored value in an input control of a form

 
0
  #1
Sep 11th, 2005
I'd would like in a form with an input control, that the first autocomplete value is visible in the textbox instead of a blank field.

Is it possible in javascript ?

Thanks a lot
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 107
Reputation: madmital is an unknown quantity at this point 
Solved Threads: 3
madmital madmital is offline Offline
Junior Poster

Re: Preselection of stored value in an input control of a form

 
0
  #2
Sep 12th, 2005
'this what you need?
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <HTML>
  2. <HEAD>
  3. <SCRIPT TYPE="text/javascript">
  4. function insertvalue()
  5. {
  6. document.formname.sometext.value = "default value";
  7. }
  8. </SCRIPT>
  9. </HEAD>
  10.  
  11. <BODY BGCOLOR="#FFFFFF" onload="insertvalue()">
  12.  
  13. <FORM NAME="formname">
  14. <INPUT TYPE="text" NAME="sometext">
  15. </FORM>
  16. </BODY>
  17. </HTML>
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 2
Reputation: FlyBoy767 is an unknown quantity at this point 
Solved Threads: 0
FlyBoy767 FlyBoy767 is offline Offline
Newbie Poster

Re: Preselection of stored value in an input control of a form

 
0
  #3
Sep 12th, 2005
Thank for you replly but ...
No no,
I'd like to put in the box the first value available with autocomplete.
You know, when you click on a box if your autocomplete is turned on, the browser propose you the stored values in a list.
Thanks

As I search for it I only found a solution in VB with sendkeys function.
But I'd prefer in Java, asp (don't think a server-side could do it), or html.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Preselection of stored value in an input control of a form

 
0
  #4
Sep 12th, 2005
The "autocomplete" is an often very annoying and disruptive "feature" of a particular browser or browser plug-in (like the Google Toolbar). As far as I know, a standardized autocomplete was never made part of the JavaScript DOM, so you can't do what you're trying to do.
Reply With Quote Quick reply to this message  
Reply

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




Views: 3258 | Replies: 3
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC