Hi all,
I try to call onchange a function and get "missing ) after argument
list" error
Probably systaxis issue
Thanks in advance for any help!
Code:
var html = "";
var myurl = "http://www.example.com/url.php?dummy=";
html += "<form id='idnumber' method='get' name='formnumber' action='#'
>";
// hier is the problem place
html += "<select name='name_sel' onchange='My_Function(myurl +
this.form.formnumber.options[this.form.name_sel.options.selectedIndex].value ,My_function_2 ,
parameter3)'>";
html += "<Option selected='selected' value='opt0'>option 0</option>";
var z
var ind = new Array("option 0","option 1","option 2");
for (z in ind)
{
html +="<option value" + ind[z] + ">" + ind[z] + "</option>";
}
html += "</select></form>";
Randy Webb - 30 Mar 2007 22:37 GMT
Vv_vV said the following on 3/30/2007 5:24 PM:
> Hi all,
> I try to call onchange a function and get "missing ) after argument
[quoted text clipped - 13 lines]
> this.form.formnumber.options[this.form.name_sel.options.selectedIndex].value ,My_function_2 ,
> parameter3)'>";
alert(html);
And see what it is. It may not be what you think it is.

Signature
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Michael - 31 Mar 2007 00:26 GMT
> Vv_vV said the following on 3/30/2007 5:24 PM:
>
[quoted text clipped - 25 lines]
> comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
> Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
Hi, Randy
myurl variable doesn't work. it shows myurl instead of text in it
so I escaped properly:
var myurl = '\"http://www.example.com/url.php?dummy="';
with no luck
alert shows
<select name='name_sel' onchange='My_Function(myurl +
this.form.formnumber.options[this.form.name_sel.options.selectedIndex].value ,My_function_2 ,
parameter3)'>
don't know what to do...
Thanks a lot!
Michael - 31 Mar 2007 00:36 GMT
On Mar 31, 1:26 am, "Michael" <fj4sgcv5hy6d...@temporaryinbox.com>
wrote:
> > Vv_vV said the following on 3/30/2007 5:24 PM:
>
[quoted text clipped - 40 lines]
> don't know what to do...
> Thanks a lot!
I've also tried this
<select name='name_sel' onchange='My_Function(\"http://www.example.com/
url.php?dummy=\"' +
this.form.formnumber.options.name_sel[selectedIndex].value ,My_function_2 ,
parameter3)'>
no luck...
Patient Guy - 31 Mar 2007 08:13 GMT
"Vv_vV" <kenyuk@gmail.com> wrote in comp.lang.javascript:
> Hi all,
> I try to call onchange a function and get "missing ) after argument
[quoted text clipped - 6 lines]
> this.form.formnumber.options[this.form.name_sel.options.selectedIndex].
> value ,My_function_2 , parameter3)'>";
Are breaking a string literal up on multiple lines??
Or is that your NNTP posting client wrapping lines?
If the former, your error is obvious, and you need to understand how to
continue a string literal on multiple lines.
Michael - 31 Mar 2007 14:59 GMT
> "Vv_vV" <ken...@gmail.com> wrote in comp.lang.javascript:
>
[quoted text clipped - 15 lines]
> If the former, your error is obvious, and you need to understand how to
> continue a string literal on multiple lines.
Hi,
I know how to break the lines, that are wrapping lines