PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do you check for an empty field in a form?


You can check in two ways using php and javascript. If You want client side validation then you can use javascript or if you want server side validation then you can use php.

using javascript

if(document.formnm.fieldnm.value=='')
{
alert('your message');
return false;
}

using php

if($_REQUEST['fieldnm']=='') { echo "Your Message"; }

Answered by: NikJoshi
http://www.jsgnweb.com

Comment on this Question and Answer >>>

ASK A QUESTION

More forms PHP Questions

How can I check that a data value is alphanumeric?

How do I email the contents of a form to me?

Hi all , I use CURL to login to webtrafficagents.com . I got the script and modified it to login to several sites , but it can't login to this one , any experts can help , a reward is granted :) what i want : I want to be able to view the source

I have a form that I need to do two things: send all the input values to a confirmation/pay page, and send to me via email. Payment is based on what the customer picks (naturally). The way I have it set up is the form action goes to the confirmat

How can I access information sent through POST on a form?



Custom Search