Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Function work in IE 8 or 9 but not in Chrome

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Function work in IE 8 or 9 but not in Chrome

    The following Function work in IE 8 or 9 but not in Chrome

    See error below:



    function runSearch() {

    var tmptarget = (document.forms(0).target);

    Error - Uncaught TypeError: Property 'forms' of object #<HTMLDocument> is not a function (repeated 2 times)

    var tmpaction = (document.forms(0).action);

    document.forms(0).action = "SSearch.aspx?SEARCHTYPE=" + encodeURI(document.getElementById("SSearchType").o ptions[document.getElementById("SSearchType").selectedInd ex].value) + "&SSEARCHVALUE=" + encodeURI(document.getElementById("SSearchValue"). value);
    document.forms(0).target = "_self";
    document.forms(0).submit();
    document.forms(0).target = tmptarget;
    document.forms(0).action = tmpaction;
    }



    I need to know what to change to make this work.

    GAMC


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: Function work in IE 8 or 9 but not in Chrome

    Thread moved from members introductions.

    I suggest you read the Forum Rules, in particular points 1, 3d, and 10. This is a java forum, and javascript != java. Your other post has been locked.

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Function work in IE 8 or 9 but not in Chrome

    I have not found how to close this request.

    Please close.

    GAMC

Similar Threads

  1. Java Script works in IE 8 and 9 but not in Chrome
    By GAMC in forum Other Programming Languages
    Replies: 1
    Last Post: July 30th, 2012, 10:56 PM
  2. [SOLVED] Sine function, can't get factorial to work
    By Actinistia in forum What's Wrong With My Code?
    Replies: 4
    Last Post: May 27th, 2012, 11:24 AM
  3. Function in Function?
    By junxiqqq in forum Java Theory & Questions
    Replies: 5
    Last Post: May 18th, 2012, 08:05 PM
  4. need help with a function...
    By fallout87 in forum What's Wrong With My Code?
    Replies: 8
    Last Post: November 2nd, 2011, 05:42 AM