View Full Version : missing a ( or { or ;

07-04-2007, 02:40 PM
here's 6 lines of code

var x=document.getElementById("whatever")
var teamgrab= x.options[x.selectedIndex].text;
googleurl= googleurl + teamgrab.value;

first line grabs the form info fine
next line alerts me with the proper value
The 3rd line gives me an "undefined" value when I use alert to check it's value.

I've tried what I think is every combination of parenthesis and brackets and.....grrr I can't figure out where my mistake is.

Could someone please rewrite line 3 correctly

Mr J
07-04-2007, 02:52 PM
Try changing this line

googleurl= googleurl + teamgrab.value;


googleurl= googleurl + teamgrab;

are you wanting the text or the value of the selected option?

07-04-2007, 02:55 PM
IE this

<option value="something">THIS</option>

ETA thanks for the suggestion but that didn't work
thanks anyway though I appreciate the reply

Mr J
07-04-2007, 02:58 PM
Then you want

googleurl= googleurl + teamgrab;

07-04-2007, 02:59 PM
That did work
I can't read;)
Thank you!!!