DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   PHP (http://www.daniweb.com/forums/forum17.html)
-   -   PHP: Form Validation (http://www.daniweb.com/forums/thread56973.html)

krea2r Oct 3rd, 2006 4:06 pm
PHP: Form Validation
 
Hey there all. I wanted to know if there was a way to use php to validate form.

Well in more detail, I wanted to know if it was possible to print a msgbox using php telling the user he has missed some thing rather than having to display a new page. Also I don't want to use javascript if possible. Would like to thank in advance.

stymiee Oct 3rd, 2006 4:37 pm
Re: PHP: Form Validation
 
Of course there is. This is basic PHP. Have you tried to write code for this yet?

pcschrottie Oct 3rd, 2006 4:42 pm
Re: PHP: Form Validation
 
Hi,

Whats so bad in displaying the form again? If a input field is empty, you just give it a value like value="Please fill out this field". I think most sites do it like that, and message boxes without JavaScript are hardly possible.


Michael

MCP Oct 3rd, 2006 7:46 pm
Re: PHP: Form Validation
 
If you wanted to use php functions to do the validation (say against database entries and such), then you might want to consider using an ajax library such as xajax, and make it look spiffy using something like scriptaculous (ok, maybe I'm going overboard, but it can be very slick). I've used that to validate form fields against a database, and point out where issues might exist.

But, you can't really get away from javascript, if you don't want the page to reload. PHP is a server side language, meaning that once the form is rendered and sent to the browser, there's NO link with the server again until you submit back (or use ajax like stuff).

Personally, I prefer just doing client-side javascript validation, as its easier to point out to the user where errors lie. That's not to say that you don't need to revalidate once you hit php, as the javascript side is easily forgeable.

krea2r Oct 10th, 2006 2:23 pm
Re: PHP: Form Validation
 
Thanks a lot guys for your help. I think i will stick with the form being reshown for the moment till i get a little more grisps with this php. THANKS A LOT AGAIN.

er.amitkatoch Oct 25th, 2007 5:23 am
Re: PHP: Form Validation
 
I wanted to know if there was a way to use php to validate form.

Well in more detail, I wanted to know if it was possible to print a msgbox using php telling the user he has missed some thing rather than having to display a new page. Also I don't want to use javascript if possible.

vinothkumar023 Jul 28th, 2009 12:37 am
Re: PHP: Form Validation
 
Quote:

Originally Posted by krea2r (Post 259482)
Hey there all. I wanted to know if there was a way to use php to validate form.

Well in more detail, I wanted to know if it was possible to print a msgbox using php telling the user he has missed some thing rather than having to display a new page. Also I don't want to use javascript if possible. Would like to thank in advance.

I wanted to know if it was possible to print a msgbox using phpvalidation must be in php


All times are GMT -4. The time now is 3:06 am.

Forum system based on vBulletin Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2010 DaniWeb® LLC