quick javascript writer thing
August 18, 2006 12:14 PM Subscribe
I'd like some premade javascript that adds text into a text input when clicked, sounds simple but I cant find anything on the web. anyone know of a script that can help me out?
function addToInputtBox( c, text ) {
c.value += text ;
}
Call the function witthe the input and the text you want to add.
posted by orthogonality at 2:42 PM on August 18, 2006
c.value += text ;
}
Call the function witthe the input and the text you want to add.
posted by orthogonality at 2:42 PM on August 18, 2006
Either (using a separate link to add the text):
<input id="whatever">
<a href="javascript:document.getElementById('whatever').value+='text to add'">Add text</a>
or (adding the text whenever you click the field):
<input onclick="this.value+='text to add'">
(I'm not sure which you're asking for)
posted by cillit bang at 4:26 PM on August 18, 2006
<input id="whatever">
<a href="javascript:document.getElementById('whatever').value+='text to add'">Add text</a>
or (adding the text whenever you click the field):
<input onclick="this.value+='text to add'">
(I'm not sure which you're asking for)
posted by cillit bang at 4:26 PM on August 18, 2006
This thread is closed to new comments.
posted by Steven C. Den Beste at 12:16 PM on August 18, 2006