944,162 Members | Top Members by Rank

Ad:
Sep 11th, 2005
0

Preselection of stored value in an input control of a form

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
FlyBoy767 is offline Offline
2 posts
since Sep 2005
Sep 12th, 2005
0

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

'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>
Reputation Points: 10
Solved Threads: 5
Junior Poster
madmital is offline Offline
119 posts
since Jun 2005
Sep 12th, 2005
0

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

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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
FlyBoy767 is offline Offline
2 posts
since Sep 2005
Sep 12th, 2005
0

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

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.
Team Colleague
Reputation Points: 227
Solved Threads: 37
Made Her Cry
tgreer is offline Offline
1,697 posts
since Dec 2004

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: What to choose?
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Get querystring





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


Follow us on Twitter


© 2011 DaniWeb® LLC