Re: Problem regarding select boxes
| From: | nayco | Date: | Tue, 11 Sep 2001 07:45:17 +0000 |
| Subject: | Re: Problem regarding select boxes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-66866@lists.php.net to get a copy of this message | ||
Try something like
< script language="JavaScript">
if (inv_name.value=='mobile')
{
inv_imei.style.visibility=visible; .........
based on CSS and JS !!!
but this is VERY fast written and may only work on IE, not NS .
(°- Nayco,
//\ Nayco@netcourrier.com
v_/_ http://nayco.free.fr
----- Original Message -----
From: Balaji Ankem <balaji.ankem@wipro.com>
To: Renze Munnik <renze@datalink.nl>
Cc: <php-general@lists.php.net>
Sent: Tuesday, September 11, 2001 9:05 AM
Subject: [PHP] Problem regarding select boxes
> Hi! friend,
> I had one html form .
> In that i had 5 inputs.
> First option is a select box.
> If the selected item is Mobile then only i want to display second and
> third input boxes. Otherwise i want to hide those two options.
>
> How can i endure that?
>
> Please give the solution to this problem.
>
> Thanks and regards
> -Balaji
>
> Here i am sending the file..
>
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> <!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en">
> <html>
> <head>
> <META HTTP-EQUIV="Refresh"
>
> content="120;URL=http://localhost/imac/addinventory.php">
>
>
> <script language="Javascript">
>
>
> function check(){
>
> if(document.addinv.inv_name.options[0].selected)
> {
> alert('Please select the item name');
> document.addinv.inv_name.focus();
> return false;
> }
> else if(document.addinv.inv_type.options[0].selected)
> {
> alert('Please select the item type');
> document.addinv.inv_type.focus();
> return false;
> }
>
>
> else if (document.addinv.inv_tag.value=='' ||
> document.addinv.inv_tag.value=='0')
> {
> alert('Inventory tag is required and it must start with
> alphabet.Please try again');
> document.addinv.inv_tag.focus();
> return false;
>
> }
>
>
> else
> { document.addinv.method = "POST";
> document.addinv.action="add_inv.php";
> document.addinv.submit();
> return true;
> }
> }
>
> </script>
> </head>
>
> <body background="imacbg1.gif" ONLOAD="document.addinv.inv_name.focus()"
> >
>
> <center> <h1> ADD INVENTORY ITEM </h1></center>
> <! Get current time and date >
> <?php $today = date("Y:m:d h:i:s"); ?>
> <center>
>
> <h3> TIME STAMP: <?php echo $today; ?> </h3>
> <form name="addinv" >
>
> Item Name :
> <select name="inv_name" STYLE="width : 120px">
>
> <option value="0" SELECTED>SELECT</option>
> <option value="Mobile">Mobile</option>
> <option value="SIM">SIM</option>
> <option value="Data Cable">Data Cable</option>
> <option value="Charger">Charger</option>
> <option value="Power Supply">Power Supply</option>
>
> </select>
>
> Item Type:
> <select name="inv_type" STYLE="width : 120px" >
>
> <option value="0" SELECTED>SELECT</option>
> <option value="PTX520">PTX520</option>
> <option value="PTX438">PTX438</option>
> <option value="J5">J5</option>
> <option value="J6">J6</option>
> <option value="Z5">Z5</option>
>
> </select>
>
>
> IMEI Number<input type="text" name="inv_imei" size="15"
> value="">
>
> Item Tag <input type="text" name="inv_tag" size="15"
> value="">
>
> Status <select name="inv_status" STYLE="width : 120px">
> <option value="0" SELECTED>SELECT</option>
> <option value="stock">STOCK</option>
> <option value="inuse">IN USE</option>
> </select>
>
> <input type="button" Value="ADD"
> OnClick="check();"></td>
> </form>
> </center>
> </body></html>
>
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> If Item name is Mobile then only we can enter type and IMEI...otherwise i
> want to hide and i will insert blank values in to the database.
>
>
> Thanks in advance.
>
> Regards
> -Balaji
>
>
----------------------------------------------------------------------------
----
> --
> 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