missing ) after argument list error

V

Vv_vV

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>";
 
M

Michael

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
list" error
Probably systaxis issue
Thanks in advance for any help!

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)'>";

alert(html);

And see what it is. It may not be what you think it is.

--
Randy
Chance Favors The Prepared Mind
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!
 
M

Michael

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
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)'>";
alert(html);

And see what it is. It may not be what you think it is.
--
Randy
Chance Favors The Prepared Mind
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!

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...
 
P

Patient Guy

Vv_vV said:
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!


// 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)'>";


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.
 
M

Michael

Vv_vV said:
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!
// 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)'>";

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.

Hi,
I know how to break the lines, that are wrapping lines
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top