Re: select option value into a variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's a pure php version.

<html>
<head>
<title>Display Option</title>

</head>
<body>

<form name="form1" method="GET" action="select.php">

ex: <select name="product">
<option value="a">Apple</option>
<option value="b">Orange</option>
</select>

<p><input TYPE="submit" </p>

</form>

<?php $option_var = $_GET["product"];
print "Option Var = " . $option_var . "<br />";
?>
</body>
</html>


Internet Content Developer
tbirchmire@xxxxxxx


------ Original Message ------
Received: Wed, 15 Sep 2010 10:27:54 AM EDT
From: vijaya lakshmi <vijayalakshmi6jun@xxxxxxxxx>
To: php-objects@xxxxxxxxxxxxxxx
Subject: Re:  select option value into a variable

> so i need access using ajax call is it..........
> 
> Can you please help me out with an example ...........
> 
> On Wed, Sep 15, 2010 at 7:43 PM, Pete <cgrp@xxxxxxxxxxxx> wrote:
> 
> >
> >
> > In message
<AANLkTim2HnJ6KCwj06z-XdfL06FrjExnQXjcRZCvXygy@xxxxxxxxxxxxxx<AANLkTim2HnJ6KCwj06z-XdfL06FrjExnQXjcRZCvXygy%40mail.gmail.com>
> > >, vijaya lakshmi
<vijayalakshmi6jun@xxxxxxxxx<vijayalakshmi6jun%40gmail.com>>
> > writes
> >
> > >Hi,
> > >need to take the option value of select into a php variable.
> > >
> > >Can you plz help me in doing this.
> > >
> > >ex: <select name="product">
> > ><option value="a">Apple</option>
> > ><option value="b"></option>
> > ></select>
> > >
> > >so if i select apple then another list box is to be generated.
> > >
> > >if i select orange a diffrent list box should be generated.
> > >
> > >Can you please guide me on how to go about this.
> > >
> > >Thanks in advance......
> >
> > I have two versions of this running:
> > select a continent, then a list of countries in the continent appears,
> > select a country and a list of states appears,
> > etc
> >
> > In an older one, I had the select inside an IFRAME, so that only that
> > part of the screen appeared to change, and the main screen stays the
> > same.
> >
> > A more modern version uses Ajax to collect the country data for the
> > continent (this becomes much more worthwhile when you collect the state
> > data for each country).
> >
> > Have a look at Ajax in Google. Much more flexible. But the old
> > fashioned IFRAME is simpler and easier to code if you are new and just
> > want to get it working.
> >
> > --
> > Pete Clark
> >
> > Local sites for Local People in Spain
> > http://localFaces.net
> >
> >  
> >
> 
> 
> 
> -- 
> Thanks & Regards
> Vijayalakshmi
> 
> 
> [Non-text portions of this message have been removed]
> 
> 
> 
> ------------------------------------
> 
> Are you looking for a PHP job?
> Join the PHP Professionals directory Now!
> http://www.phpclasses.org/jobs/
> Yahoo! Groups Links
> 
> 
> 



[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux