Thanks,
I'm implementing the code.
I have a submit button:
<form method="POST" action="action-user.php?act=addtr">
<input class="loginbox" name="newinvdesc" type="text" size="23" maxlength="15" />
<input border="0" src="img/button-submit.gif" name="Submit" value="Submit" type="image" onclick="showhide2(this, 'txt1','hide');">
</form>
I have a function:
Code:
<script type="text/javascript">
function showhide2(what,obj,which) {
alert("Your desc is " . $_POST['newinvdesc']);
}
</script>
I want to check the data fields are input and if not stop the form from 'POST' to action-user.php.
Which leads to 2 questions..
how do I get the value of a field since _POST and _GET won't work?
how do I stop the post continuing since exit; doesn't stop it?
Thanks