View Full Version : How to prevent exit from text field?

11-02-2006, 04:24 PM
I would like to prevent exit from a text field if the value is invalid.

Can I code it using the onchange="..." using something like this?

<input type=text name=username value="<?php echo $username ?>"onChange="if(!$Members_Account->isUserExists($username)){<script language=javascript> alert('<?php echo "Username is not available" ?>') </script>}">

11-02-2006, 04:36 PM
That is javascript, not PHP.