Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #8716
| From | "J.O. Aho" <user@example.net> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: validation of a text box input... |
| Date | 2013-03-18 20:28 +0100 |
| Message-ID | <aqp86hFi7b6U1@mid.individual.net> (permalink) |
| References | <a00dc856-f0c2-4dda-b972-bb8fc7097ce6@googlegroups.com> |
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
Back to comp.lang.php | Previous | Next — Previous in thread | Find similar | Unroll thread
validation of a text box input... nag <visitnag@gmail.com> - 2013-03-18 08:46 -0700
Re: validation of a text box input... Salvatore <sal@yojimbo.hack.invalid> - 2013-03-18 18:19 +0000
Re: validation of a text box input... nag <visitnag@gmail.com> - 2013-03-18 16:54 -0700
Re: validation of a text box input... Salvatore <sal@yojimbo.hack.invalid> - 2013-03-19 16:13 +0000
Re: validation of a text box input... "J.O. Aho" <user@example.net> - 2013-03-18 20:28 +0100
csiph-web