Reset $_POST (in WP ??)


function testSubmit()
{
var x = document.forms["myForm"]["input1"];
var y = document.forms["myForm"]["input2"];
if(x.value =="" || y.value=="")
{
alert('Not allowed!!');
return false;
}
return true;
}
function submitForm()
{
if(testSubmit())
{
document.forms["myForm"].submit(); //first submit
document.forms["myForm"].reset(); //and then reset the form values
}
}

Published by

Per Thykjaer Jensen

- Code is the heart of all multimedia productions. Code can animate your creative visions.
Per Thykjaer Jensen teaches multimedia programming at Aarhus Buisiness Academy. He is MA it, interaction design and multimedia, MA literature history and BA art history.