Forums
This topic is locked
Clicking link fills out form field. - Possible?
30 Jan 2007 23:48:30 Tom Scott posted:
Is it possible to have a link enter a form field value?For example.. I have a form with a "completed date / time" text input.. I want to have a link next to the field with something like "Click for Now" which will input <%=NOW%> into that field without leaving the page.
How can I do this?
THanks a lot.
Replies
Replied 31 Jan 2007 03:03:26
31 Jan 2007 03:03:26 Dan Berdusco replied:
A simple javascript should do the trick:
<pre id=code><font face=courier size=2 id=code><a href="#" onClick="javascript:document.formName.textBoxName.value = '<%=now()%>';">Click for Now</a> </font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code><a href="#" onClick="javascript:document.formName.textBoxName.value = '<%=now()%>';">Click for Now</a> </font id=code></pre id=code>
Replied 31 Jan 2007 03:05:22
31 Jan 2007 03:05:22 Dan Berdusco replied:
Another option would be to submit a hidden field with the default value of now()
Replied 31 Jan 2007 15:01:03
31 Jan 2007 15:01:03 Tom Scott replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
A simple javascript should do the trick:
<pre id=code><font face=courier size=2 id=code><a href="#" onClick="javascript:document.formName.textBoxName.value = '<%=now()%>';">Click for Now</a> </font id=code></pre id=code>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Awesome!!! Thank you very much!
A simple javascript should do the trick:
<pre id=code><font face=courier size=2 id=code><a href="#" onClick="javascript:document.formName.textBoxName.value = '<%=now()%>';">Click for Now</a> </font id=code></pre id=code>
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Awesome!!! Thank you very much!