Could someone fixed this codes, i want the value inside the text fields will empty after submit the form..
huhu...:?:
<script type="text/javascript">
$(document).ready( function() {
$('#submit_id').click(function(){
doUpload();
});
$('#uploadprogress').hide();
});
function doUpload()
{
// STEP 2. Create the iframe object
var iframe;
try {
iframe = document.createElement('<iframe name="uploadiframe">');
}
catch (ex) {
iframe = document.createElement('iframe');
iframe.name='uploadiframe';
}
iframe.src = 'javascript:false';
iframe.id = 'uploadiframe';
iframe.className ='iframe';
document.body.appendChild(iframe);
// STEP 3. Redirect the form to iframe
$('#form').attr('target','uploadiframe');
// STEP 4. Display the progress layer
$('#uploadform').hide();
$('#uploadprogress').show();
$('#uploadiframe').hide();
// .STEP 5. Intercept the upload result
$('#uploadiframe').load(function () {
$('#uploadprogress').hide();
$('#uploadform').show();
// STEP 6. Inform the user about the result
var result = $('body', this.contentWindow.document).html();
if(result == 1){
$('#result1').html('<font color="#060">Successful :)</font>');
}
else{
$('#result1').html('<font color="#060">Successful :)</font>');
}
// STEP 7. Destroy the iframe
setTimeout(function () {
$('#uploadiframe').remove();
}, 50);
});
}
</script>
<form name="execute" action="Comment_System/contactajax.php" method="post" style="padding:30px; text-align:center;" onSubmit="return validateContactForm(this);" id="form">
<input type="text" name="name" id="name" placeholder="Name" title="Enter your name, fullname is better">
<input type="text" name="email" id="email" placeholder="Email Address" title="Enter your email address" >
<input type="text" name="subject" id="subject" placeholder="Subject" title="Enter the Subject (Header) of your message" >
<textarea name="message" id="message" placeholder="Message" title="Enter your message here (use as many space as you want)" ></textarea>
<input type="text" id="answer_contact" name="answer_contact" placeholder="Answer this, 3 + 7 = ?" title="Answer this simple question" ><br />
<input type="submit" id="submit_id" class="submit_id" value="Submit" style="text-align:center;" title="Submit your message" ><br />
<p><div id = "uploadprogress">
<img src="loader.gif"/>
</div></p>
<span id="result1"></span>
</form>