Displaying a Dynamic Message<

liunx

Guest
I'm trying to do form validation. If an element of the form is, say, left blank, I want to send a "clickable" message to the user that says, "Not all fields are full."

I know how to do this is VBScript (Msg("Text here")), But how do you do it in PHP. Just a simple message or alert.PHP does not have a popup box function, however.

If($field_name=="") {
echo "you did not fill in all of the fields".
echo "<a href='http://www.htmlforums.com/archive/index.php/onclick=history.go(-1)'>back</a>";
}

or similar to that, I think.PHP is processed by the server and so, even if PHP did have a window.open method, it would do little good because the message would popup on the server.

If you want to do this, use javascript.Can't you use PHP to validate, then echo the javascript?My head was clouded with confusion the day that I originally posted. No, you can't do form validation for the purpose of validating a client-side form. I don't know what I was thinking.
 
Back
Top