473,395 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Countries in a select field

I have Countries in a drop-down list.

Any countries with more than one word are not captured properly in form
variables. Only the first word is captured to the variable. So, for
instance, if 'British Virgin Islands' is selected, only 'British' is
captured to the form variable.

Any thoughts on why this is happening?

Thanks,

Scott
Jul 17 '05 #1
6 1982
Scott Castillo wrote:
I have Countries in a drop-down list.

Any countries with more than one word are not captured properly in form
variables. Only the first word is captured to the variable. So, for
instance, if 'British Virgin Islands' is selected, only 'British' is
captured to the form variable.


You have to surround the value with quotes

Try this:

#v+
<?php
echo <<<HTML
<form action="" method="post">
<select name="x">
<option>one two three</option>
<option value="four five six">four five six</option>
<option value=seven eight nine>seven eight nine</option>
</select>
<input type="submit"/>
</form>
HTML;

echo '<pre>'; print_r($_POST); echo '</pre>';
?>
#v-
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Jul 17 '05 #2
On Thu, 26 Feb 2004, Pedro Graca wrote:
Any countries with more than one word are not captured properly in form
variables. Only the first word is captured to the variable. So, for
instance, if 'British Virgin Islands' is selected, only 'British' is
captured to the form variable.You have to surround the value with quotes
Try this:

<snip> <option>one two three</option>
<option value="four five six">four five six</option>
<option value=seven eight nine>seven eight nine</option>

<snip>

Or, if you really do want to have the content of the element sent back, just
omit the 'value' attribute on option.

--
ash
a-k
.... If she doesn't scare ya, no evil thing will...

Jul 17 '05 #3
På Thu, 26 Feb 2004 08:06:13 -0800, skrev Scott Castillo <sc*****@cox.net>:
I have Countries in a drop-down list. (...)


This is *so* OT. This is HTML. Ask a HTML group.

--
Fred H

void FredH::Contact() {
TextToSpeach.say("frode at age dee dee dot en oh");
}
Jul 17 '05 #4
Thank you very much.

"Pedro Graca" <he****@hotpop.com> wrote in message
news:c1*************@ID-203069.news.uni-berlin.de...
Scott Castillo wrote:
I have Countries in a drop-down list.

Any countries with more than one word are not captured properly in form
variables. Only the first word is captured to the variable. So, for
instance, if 'British Virgin Islands' is selected, only 'British' is
captured to the form variable.


You have to surround the value with quotes

Try this:

#v+
<?php
echo <<<HTML
<form action="" method="post">
<select name="x">
<option>one two three</option>
<option value="four five six">four five six</option>
<option value=seven eight nine>seven eight nine</option>
</select>
<input type="submit"/>
</form>
HTML;

echo '<pre>'; print_r($_POST); echo '</pre>';
?>
#v-
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--

Jul 17 '05 #5
Thank you very much.

"Ash Argent-Katwala" <as*@videdot.com> wrote in message
news:Pi*******************************@gauss.doc.i c.ac.uk...
On Thu, 26 Feb 2004, Pedro Graca wrote:
Any countries with more than one word are not captured properly in form
variables. Only the first word is captured to the variable. So, for
instance, if 'British Virgin Islands' is selected, only 'British' is captured to the form variable.You have to surround the value with quotes
Try this:

<snip>
<option>one two three</option>
<option value="four five six">four five six</option>
<option value=seven eight nine>seven eight nine</option>

<snip>

Or, if you really do want to have the content of the element sent back,

just omit the 'value' attribute on option.

--
ash
a-k
... If she doesn't scare ya, no evil thing will...

Jul 17 '05 #6
Fred H wrote:
På Thu, 26 Feb 2004 08:06:13 -0800, skrev Scott Castillo <sc*****@cox.net>:
I have Countries in a drop-down list. (...)

This is *so* OT. This is HTML. Ask a HTML group.


He's not reading the variables with html, right?

IMO form processing and creation ain't OT.

Rudi
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: kirku | last post by:
hi all, i'd like to know if exist a redy lists of countris of world, to use in a Form as "SELECT" input data, to choose one of lists. Thank you for ansewer
0
by: bhavik | last post by:
Is there a database in .Net which lists all countries, cities, addresses, etc. (first browse and select from avavilable countries, then once specified, all available cities in this country can be...
3
by: bhavik | last post by:
Is there a database in .Net which lists all countries, cities, addresses, etc. (first browse and select from avavilable countries, then once specified, all available cities in this country can be...
7
by: David Freeman | last post by:
Hi There! I'm trying to create a User Registration page in ASP.NET and wondering what is the best way to get the list of up-to-date Countries and Cities? Are there any Web Services on the web...
2
by: PRS | last post by:
Why does 'SELECT * FROM countries' truncate characters and SELECT country FROM countries does not ? mysql> SELECT * FROM countries; +-------------+-----------+ | country | capital |...
2
by: Brendon Bezuidenhout | last post by:
All, Real daft one here - Does anyone know where I can find a list of all countries, areas and cities to populate into Combo Boxes on a web form possibly? Thanks in advance Brendon
22
by: Ubi | last post by:
I am looking for a list of countries and nationalities, against the top level domain. es: ..ar ==Argentina ==Argentinian ..al ==Albania ==Albanian etc. etc.
1
by: slinky | last post by:
I want to get an opinion on some .aspx logic. Say for isntance you have a user data submission form that amongst other things is gathering STATE and COUNTRY information of which appear in a...
3
by: rajanji | last post by:
Hi all, Can anyone here explain me how to make a dropdownlist for countries... i.e i want to make a ddl having list of countries .... as the user select a country from that ddl the name of the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.