Re: [WSG] How to send two values to javascript

2007-11-15 Thread Michael Horowitz
Now firebug gives the error showSubcategory2(document.getElementById( Code is Code samples I've been able to review select name=subcategory id = subcategory onchange=showSubcategory2(document.getElementById('category').value,this.options[this.selectedIndex].value); I know this will be

Re: [WSG] How to send two values to javascript

2007-11-15 Thread Michael Horowitz
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

Re: [WSG] How to send two values to javascript

2007-11-15 Thread Michael Horowitz
Still fighting with this. Since I've taken the variables out of the javascript it is called like this select name=subcategory id = subcategory onchange=showSubcategory2() But firebug keeps showing the error as missing ) after argument list showSubcategory2(document.getElementById() I'm

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Benedict Wyss
I believe it is as follows; onchange=showSubcategory(name, email, message) --- if they are the name=name and name=email, etc. or, if you want to parse text, then onchange=showSubcategory(banana, orange, apple) -- So when it arrives at the script it becomes an array starting at [0] to be used

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Olly Hodgson
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

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Olly Hodgson
On Nov 14, 2007 11:11 PM, Olly Hodgson [EMAIL PROTECTED] wrote: onchange=showSubcategory(this.value, document.getElementById(anotherElement).value); While I'm here, two points: Doing anything major using the onchange event isn't a great idea. The reason being it can scupper keyboard users --

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Michael Horowitz
I just ordered the book. Thanks for the help I test out the solutions given. Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Olly Hodgson wrote: On Nov 14, 2007 11:11 PM, Olly Hodgson [EMAIL PROTECTED] wrote: onchange=showSubcategory(this.value,

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Michael Horowitz
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

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Casey Farrell
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

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Michael Horowitz
I've tried single quotes and keep getting the error document.GetElementByID has no properties Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Casey Farrell wrote: Try using single quotes, as in: select name=category

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Michael Horowitz
I think you may have something with this secondSelect.items as I am using a select menu. Can you explain where I would put my variable names in here please. Thanks Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Kit Grose wrote: On 15/11/2007, at

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Michael Horowitz
I think I understand it no need for more explanation. It's too late at night and I am working with twins in the room and a wife at the airport Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Kit Grose wrote: On 15/11/2007, at 3:34 PM, Casey Farrell

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Michael Horowitz
That solves problem number 1 Michael Horowitz Your Computer Consultant http://yourcomputerconsultant.com 561-394-9079 Casey Farrell wrote: It must not be finding the element... does the element you are looking for in the document have id=category? Michael Horowitz wrote: I've tried single

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Casey Farrell
It must not be finding the element... does the element you are looking for in the document have id=category? Michael Horowitz wrote: I've tried single quotes and keep getting the error document.GetElementByID has no properties Michael Horowitz Your Computer Consultant

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Brian Cummiskey
Michael Horowitz wrote: select name=subcategory id = subcategory onchange=showSubcategory2(document.getElementById('category').value,document.getElementById('subcategory').value) try this: select name=subcategory id=subcategory

Re: [WSG] How to send two values to javascript

2007-11-14 Thread Kit Grose
The issue is that selects themselves don't have values. You notice the value is on the option tag, not the select. So you can't just get the .value of the element with ID 'subcategory'; you need to get the value of the currently selected item OF that select box. That can be done as an