I get it, good idea! Thanks! Have a great day, Alex
----- Original Message ----- From: "E.J. Zufelt" <everett@xxxxxxxxx To: <programmingblind@xxxxxxxxxxxxx Date sent: Thu, 11 Dec 2008 18:03:51 -0400 Subject: Re: another quick php question
Alex,
Here is what I'd recommend. It will allow you to get the
information that
you are looking for and make it so that you can update your list
of
providers with a simple insert or update statement in the future.
1. Create a table with the fields id, email and provider.
2. Populate the table with the necessary values, probably
setting id to
auto_increment.
3. Have the script that generates the listbox <select> get it's
values from
the database table. E.g. <option value="11">Some
Carrier</option
4. On submit of the form check the value against the id field
and get the
required values for email and provider from the database table.
HTH, Everett
----- Original Message ----- From: "Alex Hall" <mehgcap@xxxxxxx To: <programmingblind@xxxxxxxxxxxxx Sent: Thursday, December 11, 2008 6:53 PM Subject: Re: another quick php question
I have a contact manager form for sending sms messages. A select
list
shows the cell carriers, and the value of each option in that
list is the
email address. For example: <option value="@utext.com">Unicel</optionI want to put both the email address and the name of the
provider into a
database. So there is no way to get the "Unicel" if that option
were
selected, only @utext.com? That is a shame. Oh well, back to my
old
friend JavaScript for a solution most likely involving a hidden
field and
a php explode function.
Have a great day, Alex
----- Original Message ----- From: "E.J. Zufelt" <everett@xxxxxxxxx To: <programmingblind@xxxxxxxxxxxxx Date sent: Thu, 11 Dec 2008 17:33:58 -0400 Subject: Re: another quick php question
Alex,
Only if you were to put the text in the value attribute for theoptionelement.
HTH, Everett
----- Original Message ----- From: "Alex Hall" <mehgcap@xxxxxxx To: <programmingblind@xxxxxxxxxxxxx Sent: Thursday, December 11, 2008 6:29 PM Subject: another quick php question
Is there a way to have php get the text of a select list option,insteadof the value? Basically, the equivalent of the javascript: var txt=form.select.options[form.select.selectedIndex].text; I know php has the $_POST and $_GET arrays, but these getselectedoptions' values. Thanks!
Have a great day, Alex __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________View the list's information and change your settings at //www.freelists.org/list/programmingblind