Re: Submit button not appearing on the screen

From: Date: Fri, 27 Oct 2000 03:52:59 +0000
Subject: Re: Submit button not appearing on the screen
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-22259@lists.php.net to get a copy of this message
Your code essentially saying that if $fn or $age is empty when you execute the page (which is always true), you exit the application, does, you never actually execute the submit line button. Here is the code that should work: <head> <title>User Info Form</title> </head> <body> <form action=submitform.php method=get> First Name: <input type=text name=fn size=25 maxlength=25> <p> Age : <input type=text name=age size=5 maxlenght=25> <p> <input type=submit value="Submit Details"> </form> </body> on the file submitform.php, do something like: <?php if($age=="" || $fn=="") { echo "<SCRIPT>"; echo "alert('Those two columns are required');"; echo "</SCRIPT>"; exit; } ?> At 09:44 PM 10/26/2000 -0500, you wrote:
Hi all, i am pretty new to PHP world, sorry if it is very dumb question. I am having a form to collect the users first name and age. My intention is to give a javascript alert if the user didn't fill any of the fields. If the user fills both the fields this file is going to call another file (submitform.php) and confirms the user. So i am having two text fields and one submit button my page. I don't understand whether the problem is in php script or function calling, somehow the submit button is not appearing on my page and desired action is not taking place. Here is my code. ------------------------------ First Name: Age : <?php if (!$fn || !$age) { echo ""; exit; } ?> ------------------------- many thanks Chakravarthy K Sannedhi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#22259) next »