Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a textfield and a list which looks like this :
HTML
<form name="myform" method="post" action="register.php">

    Username : <input name="username" type="text">
    Country  : <select name="country">	  
               <option value="" selected></option>
               <option value="Afghanistan">Afghanistan</option>
               </select>

<input name="submit" type="button" value="REGISTER">
</form>


First, I want to check if there is empty field. Then, if there is empty field , display a red warning message like "Empty username" or "Empty Country" beside the textfield. So, when i press REGISTER button, it will display warning if there is any empty field. Otherwise, It will proceed to register.php

Thanks in advance!
Posted
Updated 11-Mar-14 4:49am
v2

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900