View Full Version : clear text field on submit
03-22-2010, 01:59 PM
hi, i have a chatbox that shows its result within an iframe, but the text field and the submit buttons are outside this iframe, so when i submit my form, its target is inside the iframe, so my text field wont clear itself. how to do that?
03-22-2010, 02:15 PM
onClick="document.getElementById('ChatField').value = '';"
03-22-2010, 02:43 PM
this way it will clear the field before it submits the data to the php file :P
03-22-2010, 02:48 PM
I would need to test it to know for sure, but it should submit the data before clearing.
otherwise use ajax to submit the query.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.