Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / JavaScript / March 2007



Tip: Looking for answers? Try searching our database.

missing ) after argument list error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vv_vV - 30 Mar 2007 22:24 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.