missing ) after argument list error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vv_vV

    missing ) after argument list error

    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='formnumbe r' action='#'
    >";
    // hier is the problem place
    html += "<select name='name_sel' onchange='My_Fu nction(myurl +
    this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].value ,My_function_2 ,
    parameter3)'>";

    html += "<Option selected='selec ted' value='opt0'>op tion 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

    #2
    Re: missing ) after argument list error

    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='formnumbe r' action='#'
    >";
    >
    // hier is the problem place
    html += "<select name='name_sel' onchange='My_Fu nction(myurl +
    this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].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.javas cript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

    Comment

    • Michael

      #3
      Re: missing ) after argument list error

      On Mar 30, 11:37 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
      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='formnumbe r' action='#'
      ";
      >
      // hier is the problem place
      html += "<select name='name_sel' onchange='My_Fu nction(myurl +
      this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].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.javas cript FAQ -http://jibbering.com/faq/index.html
      Javascript Best Practices -http://www.JavascriptT oolbox.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_Fu nction(myurl +
      this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].value ,My_function_2 ,
      parameter3)'>
      don't know what to do...
      Thanks a lot!

      Comment

      • Michael

        #4
        Re: missing ) after argument list error

        On Mar 31, 1:26 am, "Michael" <fj4sgcv5hy6d.. .@temporaryinbo x.com>
        wrote:
        On Mar 30, 11:37 pm, Randy Webb <HikksNotAtH... @aol.comwrote:
        >
        >
        >
        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='formnumbe r' action='#'
        >";
        >
        // hier is the problem place
        html += "<select name='name_sel' onchange='My_Fu nction(myurl +
        this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].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.javas cript FAQ -http://jibbering.com/faq/index.html
        Javascript Best Practices -http://www.JavascriptT oolbox.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_Fu nction(myurl +
        this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].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_Fu nction(\"http://www.example.com/
        url.php?dummy=\ "' +
        this.form.formn umber.options.n ame_sel[selectedIndex].value ,My_function_2 ,
        parameter3)'>


        no luck...

        Comment

        • Patient Guy

          #5
          Re: missing ) after argument list error

          "Vv_vV" <kenyuk@gmail.c omwrote in comp.lang.javas cript:
          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_Fu nction(myurl +
          this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].
          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.



          Comment

          • Michael

            #6
            Re: missing ) after argument list error

            On Mar 31, 9:13 am, Patient Guy <sevisen.adam@g mailDOTHEREcomw rote:
            "Vv_vV" <ken...@gmail.c omwrote in comp.lang.javas cript:
            >
            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_Fu nction(myurl +
            this.form.formn umber.options[this.form.name_ sel.options.sel ectedIndex].
            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

            Comment

            Working...