Brandon Jaeger Posted October 8, 2008 Share Posted October 8, 2008 I need to be able to click a link like this: <a href="#" onclick="someFunction('input_value', 'field_name');return false;">link</a> and have it fill whatever form object is named field_name with the value input_value. Visual example: User clicks that link above... [input_value ] Then it fills it the value="" parameter of the form object. I would make it, but I'm really bad at JavaScript. Help is appreciated!! Thanks Brandon Link to comment https://forums.phpfreaks.com/topic/127585-solved-click-link-fill-input-value/ Share on other sites More sharing options...
Brandon Jaeger Posted October 8, 2008 Author Share Posted October 8, 2008 Nevermind. I figured it out. <a href="#" onclick="document.getElementById(\'zomg\').value=\'yams\';">#</a> <input type="text" value="gaben" name="yams" id="yams"> Link to comment https://forums.phpfreaks.com/topic/127585-solved-click-link-fill-input-value/#findComment-660133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.