Imad Posted July 8, 2008 Share Posted July 8, 2008 Hi Guys, I have this code: <input type="image" alt="[b]" title="Bold" class="rich_buttons" src="inc/images/icons/bold.png" onClick="replaceSelection(document.getElementById(\'comment\'),\'[b]\',\'[/b]\');return false;" > Every time I click on the image that's suppose to add the bold tags into the textarea, it tries to submit the form. Any Ideas? Best Regards. Link to comment https://forums.phpfreaks.com/topic/113811-onclick-wont-work-need-help/ Share on other sites More sharing options...
lemmin Posted July 8, 2008 Share Posted July 8, 2008 The input type=image object submits the form onclick by default, just like the input type=submit object. Use an img object instead? Link to comment https://forums.phpfreaks.com/topic/113811-onclick-wont-work-need-help/#findComment-584908 Share on other sites More sharing options...
Wolphie Posted July 9, 2008 Share Posted July 9, 2008 I'd prefer to use the onsubmit(); event handler. Link to comment https://forums.phpfreaks.com/topic/113811-onclick-wont-work-need-help/#findComment-585133 Share on other sites More sharing options...
Imad Posted July 9, 2008 Author Share Posted July 9, 2008 Thanks for your replies guys. I'll try the onsubmit and see if ti works. Link to comment https://forums.phpfreaks.com/topic/113811-onclick-wont-work-need-help/#findComment-585467 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.