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. Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.