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

Recommended Answers

All 3 Replies

'this what you need?

<HTML>
<HEAD>
<SCRIPT TYPE="text/javascript">
function insertvalue()
{
document.formname.sometext.value = "default value";
}
</SCRIPT>
</HEAD>

<BODY BGCOLOR="#FFFFFF" onload="insertvalue()">

<FORM NAME="formname">
<INPUT TYPE="text" NAME="sometext">
</FORM>
</BODY>
</HTML>

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.