Solarpitch Posted November 24, 2007 Share Posted November 24, 2007 Hey Guys, I am looking to pass a value of a link into a text field if this is possible? If I have this code... <li><a href="javascript:void(0)">Actors</a></li> And when the user clicks on the link I want it to populate a text field below it with the word "Actors". Is this easy simple enough? Link to comment https://forums.phpfreaks.com/topic/78716-solved-passing-a-value-of-a-link-into-a-text-field/ Share on other sites More sharing options...
phpQuestioner Posted November 24, 2007 Share Posted November 24, 2007 try this: <script type="text/javascript"> function update(what) { document.getElementById('field').value = what; } </script> <a href="javascript:update('Actors')">Actors</a> <br><br> <input id="field" type="text"> Link to comment https://forums.phpfreaks.com/topic/78716-solved-passing-a-value-of-a-link-into-a-text-field/#findComment-398354 Share on other sites More sharing options...
Solarpitch Posted November 24, 2007 Author Share Posted November 24, 2007 Thats class! Thanks a mill man! Link to comment https://forums.phpfreaks.com/topic/78716-solved-passing-a-value-of-a-link-into-a-text-field/#findComment-398369 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.