www.webdeveloper.com
Results 1 to 4 of 4

Thread: anoying error

  1. #1
    Join Date
    Jan 2011
    Posts
    62

    anoying error

    hi all,

    I have a simple function

    Code:
    function uploadimg(theform){
    	theform.submit();
    	setStatus("Loading...","showimg");
    }
    That keeps giving me the following error.

    Error: missing } in XML expression
    Source File: http://localhost/java/functions.js
    Line: 5, Column: 17
    Source Code:
    theform.submit();

    I have checked and can not see any missing braces. Any ideas?

  2. #2
    Join Date
    Mar 2009
    Posts
    481
    The immediate problem isn't in the function you quote, its in the function 'theform.submit()' which is not shown here.

  3. #3
    Join Date
    Dec 2002
    Location
    St. Louis, MO, USA
    Posts
    1,582
    I don't think "theform.submit();" is a function - I think fideltfg is trying to actually submit the form using JavaScript.

    If so, and if you are passing "this.form" as the argument, try using:
    Code:
    function uploadimg(theform){
       var thisForm = theform.id;
       document.forms[thisForm].submit();
       setStatus("Loading...","showimg");
    }
    ^_^

  4. #4
    Join Date
    Dec 2010
    Posts
    207
    What you've shown looks OK, but you haven't shown enough code.

    Also it's not advisable to try executing anything after submitting a form.


    Q: I found this code...
    A: Then find its author.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles