Hi all
i have one problem in my page.
i have four textboxs.
1. Should Accept only Character
2.Should Accept only Number
3.Should check date format.
4. should check upload file.
in the above four if i leave blank or type miss match a error should indimate to the user when he clicking the Submit Button.
How is possible.?
Can you guide me?
Thanks and Regards
Umapathy
How to Validate Text and Submit Button?
Moderator: General Moderators
First of all, take a look at isset() and empty().
1. ctype_alpha()
2. ctype_digit()
3. Use select boxes to force your own format and check the range of the day, month and year - each one separately.
4. exif_imagetype(), getimagesize() and move_uploaded_file()
- Get yourself a good book.
- Read related topics on the forums here.
- Read online tutorials.
1. ctype_alpha()
2. ctype_digit()
3. Use select boxes to force your own format and check the range of the day, month and year - each one separately.
4. exif_imagetype(), getimagesize() and move_uploaded_file()
- Get yourself a good book.
- Read related topics on the forums here.
- Read online tutorials.
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
Below is some codes which hopefully helps u :
Let say u have a submit button names var and value as add
Then your validation once a submit button clicked is :
Let say u have a submit button names var and value as add
Code: Select all
<input type=submit value="add" name="var">Then your validation once a submit button clicked is :
Code: Select all
//if add button is clicked
if($var == 'add')
{
...do your checking here
}Here it is a good PHP tutorial http://codewalkers.com/tutorials/47/1.html.
Another tutorial here: http://www.php-mysql-tutorial.com/form- ... th-php.php.
Use them as an example do not copy the code.
Good luck!
Another tutorial here: http://www.php-mysql-tutorial.com/form- ... th-php.php.
Use them as an example do not copy the code.
Good luck!