Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
There are many input box in a form as below. It takes much time to fill form, so i want to create auto fill bookmarklet by using javascript. so that i can set all value of textbox using javascript.
JavaScript
<input id="addPassengerForm:psdetail:0:psgnName" name="addPassengerForm:psdetail:0:psgnName" class="input-style1 psgn-name" maxlength="16" size="20" type="text">


I have used following javascript code too fill above textbox but it is not working. please guide me where i am wrong.
JavaScript
<a class="btn btn-primary btn-lg" önclick="javascript:alert('Drag me');return false;" href="java<!-- no -->script:document.getElementById(" mrinal=";">
    Autofill
</a>



i have used an anchor tag , and on href i have written javascript code so that when i will click
on anchor tag from bookmark bar it will automatically fill value into textbox.
Please help.
Posted
Updated 25-May-14 4:28am
v2

1 solution

please ensure the proper using getElementById
call the id tag without and = mark
 
Share this answer
 
Comments
k@ran 25-May-14 20:55pm    
Please provide sample code for this.
NewPast 26-May-14 9:58am    
<pre lang="html">
<a onclick="javascript:alert('Drag me');return false;"
href="javascript:document.getElementById(" id1").some_action();">
Autofill
</a>
</pre>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900