Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8716

Re: validation of a text box input...

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From "J.O. Aho" <user@example.net>
Newsgroups comp.lang.php
Subject Re: validation of a text box input...
Date Mon, 18 Mar 2013 20:28:17 +0100
Lines 34
Message-ID <aqp86hFi7b6U1@mid.individual.net> (permalink)
References <a00dc856-f0c2-4dda-b972-bb8fc7097ce6@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net c4w9bKa9MDTE6UPK7TTVCgsMyRgP4yBTmEYeJs450/v9laXpHy
Cancel-Lock sha1:Q2yxTD84RlNdvWhRePFRhCi1ST0=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130222 Thunderbird/17.0.3
In-Reply-To <a00dc856-f0c2-4dda-b972-bb8fc7097ce6@googlegroups.com>
Xref csiph.com comp.lang.php:8716

Show key headers only | View raw


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


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