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 2 of 2

Thread: Java Script works in IE 8 and 9 but not in Chrome

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

    Question Java Script works in IE 8 and 9 but not in Chrome

    The following works in IE 8 and 9 but does not work in Chrome. See the error in bold.


    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;
    }


    What do I need to do to update the code to work with Chrome?

    GAMC


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

    Default Re: Java Script works in IE 8 and 9 but not in Chrome

    Duplicate of http://www.javaprogrammingforums.com...ot-chrome.html
    Locking.

Similar Threads

  1. Java Script or HTML
    By ravi9999 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 1st, 2012, 09:44 AM
  2. java script/PHP/Jquery Help
    By lovelyxalice in forum Other Programming Languages
    Replies: 4
    Last Post: March 25th, 2012, 10:59 AM
  3. Downloading web page with java script enabled through Java
    By mashimaro in forum Java Networking
    Replies: 1
    Last Post: November 13th, 2010, 09:28 PM
  4. Related to Html and Java Script?
    By JackyRock in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: February 17th, 2010, 03:10 AM