Hello
I have the following tag
<select name="cat" id="cat"
onchange="popUpWin('cmPhaseReload.php?category='+d ocument.getElementById('cat').options[document.getElementById('cat').selectedIndex].value
,600,600,'yes')" class="tbl_result" size="1">
the cat field is a drop down list
here's my problem
some values for the drop down have values with a space on it.
ABC DEF
when I try to pass the value to the other page I only get the ABC part.
How can I correctly pass the value?
someone told me to use a function called escape
sorta like
escape(document.getElementById('cat').options[document.getElementById('cat').selectedIndex].value)
but that didn't seem to work.
can someone help the newbie out here?
Thanks
Peter 2 2871
Peter said the following on 5/15/2006 9:34 AM: Hello
I have the following tag
<select name="cat" id="cat" onchange="popUpWin('cmPhaseReload.php?category='+d ocument.getElementById('cat').options[document.getElementById('cat').selectedIndex].value ,600,600,'yes')" class="tbl_result" size="1">
Try navigating that select with your keyboard....
But, if the onchange is firing off the select, and you are passing the
selects value, you can drop the document.get..... and just reference
this.value:
onchange="popUpWin('cmPhaseReload.php?category='+t his.value+'....)"
the cat field is a drop down list
here's my problem
some values for the drop down have values with a space on it.
ABC DEF
Quote your values
e.g.:
<option value="ABC DEF">
instead of:
<option value=ABC DEF>
The second does what you describe, the first doesn't.
Validating the HTML would have caught that.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Randy Webb wrote: Peter said the following on 5/15/2006 9:34 AM: Hello
I have the following tag
<select name="cat" id="cat" onchange="popUpWin('cmPhaseReload.php?category='+d ocument.getElementById('cat').options[document.getElementById('cat').selectedIndex].value ,600,600,'yes')" class="tbl_result" size="1">
Try navigating that select with your keyboard....
But, if the onchange is firing off the select, and you are passing the selects value, you can drop the document.get..... and just reference this.value:
onchange="popUpWin('cmPhaseReload.php?category='+t his.value+'....)"
the cat field is a drop down list
here's my problem
some values for the drop down have values with a space on it.
ABC DEF
Quote your values e.g.: <option value="ABC DEF"> instead of: <option value=ABC DEF>
The second does what you describe, the first doesn't.
Validating the HTML would have caught that.
Randy
You pointed me to the right direction, it was the quotes on the value
Thanks alot
Peter This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Raju V.K |
last post by:
can I use javascript and PHP in the following manner to create a
pop-up window:
<--- in <head> </head>
<script language=javascript>
function popup(folder1, file1)
{...
|
by: Kevin Lyons |
last post by:
Hello,
I am trying to get my select options (courses) passed correctly from
the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html
I am having difficulty getting the...
|
by: domeceo |
last post by:
can anyone tell me why I cannot pass values in a setTimeout function
whenever I use this function it says "menu is undefined" after th
alert.
function imgOff(menu, num) {
if (document.images) {...
|
by: franklinbruce |
last post by:
Hi all,
I have a ASP script which will get 2 query string value. i put val1
Value in a session and pass val2 value to javascript for parent page
reload with the specified value.
Problem i face is...
|
by: Simon |
last post by:
Hi all,
I think I've seen someone passing an emumeration in code before.
Can anyone tell me if thats possible and why i would want to.
Many thanks
Kindest Regards
|
by: kai |
last post by:
Hi, All
I try to use a Webservice CustomerOrderHistory to get customer order by
passing a "CustomerID". The Webservice works but the following code
Dim ds1 As DataSet
Dim CustomerID As...
|
by: |
last post by:
Hi,
1st, I did a search and could not find any info on this, the Google results
were good, but I'm still have issues...So any help will be great.
I have a frame page, which contains 3 frames...
|
by: Adeel Ahmad |
last post by:
Hi,
The subject sounds confusing but here is what i want to do. I have a
button on my page which says...
|
by: sfeher |
last post by:
Hi All,
I need to call a function(loaded with appendChild) for which I have the
name as a string.
....
var fnName = 'fn1';
var call = fnName + '('+ param +' )';
eval(call);
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
| |