FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » validation of a text box input...
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: validation of a text box input... [message #180780 is a reply to message #180777] Mon, 18 March 2013 19:28 Go to previous message
J.O. Aho is currently offline  J.O. Aho
Messages: 194
Registered: September 2010
Karma:
Senior Member
On 18/03/13 16:46, nag wrote:
> Hi,
>
> I have created a text box to take input to open another form. If the text box is not given any value and press enter it is activating the linked form with empty values. How to validate the text box not accept the null value. I tried with isset() function but i dont know how to apply it. The following is some part of my text box code .
>
>
>
> <form name="myform" action="nextform.php?id=<?php echo $id; ?>" method="GET">
> <li><a ><b>ID Code:</b><br/><input type="text" color:'red' style="width:10em" maxlength=9 name=id onfocus="if (this.value == 'Enter ID Code') {this.value = '';}"></a>
> <?php echo $id ?>
>
> </li>
> <li>
> <input type="submit" value="submit" style="margin-left:4.5em;color:#be1400;">
> </li>
>
> Where is the error?

http://www.php.net/manual/en/function.empty.php

if(!empty($_GET['id'])) {

}

You should have all values quoted and you shouldn't mix quote types,
there is a closed source browser that people use even if it's extremely
buggy which may fail to work properly when mixing quotes. Also validate
your HTML code with a validator, w3c has one if your IDE don't have one
built in.


--

//Aho
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: php curl only saves a cookie with tempnam()
Next Topic: Test Message
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Nov 14 19:18:16 GMT 2024

Total time taken to generate the page: 0.05307 seconds