Jump to content

Recommended Posts

Hi all

 

I am wondering if anyone knows if a script exists to do the following.

 

What I need is 2 html text form fields, when you enter text into one of the text fields, it would automatically update the other form field with the first letter of what was typed.

 

So for example, if you have the 2 form fields and you enter

 

Google

 

into the field, then it would automatically enter G into the other text field.

 

Does anyone know if this exists?

 

Thanks

Dave

Link to comment
https://forums.phpfreaks.com/topic/106287-autofill-textfield/
Share on other sites

here is a start for you

<script>
function setInput(passedValue){
document.getElementById('input2').value=passedValue;
}
</script>
<form>
<input onkeyup="setInput(this.value)" type="text" id="input1" />
<input type="text" id="input2" />
</form>

Link to comment
https://forums.phpfreaks.com/topic/106287-autofill-textfield/#findComment-544757
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.