So here is the current issue.
I am able to send a value. When sending two something strange is happening
<select name="category" id="category"
onchange="showSubcategory(document.getElementById('category').value)">
//(this works fine)
<select name="subcategory" id = "subcategory"
onchange="showSubcategory2(document.getElementById('category').value,document.getElementById('subcategory').value)">
Here you can see I am grabbing category and subcategory. I then format
my url
function showSubcategory2(category,subcategory)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var url="getsubcategory2.php"
url=url+"?category2="+category
url=url+"&subcategory2="+subcategory
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
However it shows in firebug as
http://yourcomputerconsultant.net/getsubcategory2.php?category2=HUMAN%20RESOURCES&subcategory2=undefined&sid=0.9278353600691835
Two things Human Resources is my subcategory and nothing appears in
subcategory2.
Michael Horowitz
Your Computer Consultant
http://yourcomputerconsultant.com
561-394-9079
Casey Farrell wrote:
Try using single quotes, as in:
<select name="category"
onchange="showSubcategory(document.getElementById('category').value)">
Michael Horowitz wrote:
Having trouble so I went to testing with one element like this
<select name="category"
onchange="showSubcategory(document.getElementById("category").value)">
and firebug shows a syntax error.
I tried it again taking oub the ""
<select name="category"
onchange="showSubcategory(document.getElementById(category).value)">
and then received the error message this document has not properties.
Michael Horowitz
Your Computer Consultant
http://yourcomputerconsultant.com
561-394-9079
Olly Hodgson wrote:
On Nov 14, 2007 10:37 PM, Michael Horowitz
<[EMAIL PROTECTED]> wrote:
I have examples using one value
onchange="showSubcategory(this.value)">
from a form to a script.
What if I need to send two values one from the current element in the
form and one from another element
onchange="showSubcategory(this.value,
document.getElementById("anotherElement").value);"
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [EMAIL PROTECTED]
*******************************************************************