Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to prevent exit from text field?

    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>}">

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    That is javascript, not PHP.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •