Jump to content

javascript <BUTTON> submits form when I don't want it to


dptr1988

Recommended Posts

I have a form and have a < BUTTON> with the 'onClick' event. When I click the button it clears a textarea in the form with this 'document.getElementById('daform').db_query.value=' ' ". My problem is that when I put the button inside of < FORM> tags it will submit the form after running the javascript. But when I have it out of the < FORM> tag it will just clear the text and not submit the form. Can I put the button in the < FORM> tag and still have it not submit the form? How?

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.