Results 1 to 4 of 4

Thread: Doesn't work in Netscape

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    I have a drob down menu on a web page, and when the user select one of the items, I want the page to immediately refresh, with changes made elsewhere on the page according to what the user has selected. To accomplish this, I simulate a click of a submit button, which submits the asp page to itself...

    I am using the onpropertychange event of the selection list. The following works flawlessly in IE, but does not work at all in Netscape:

    Code:
    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
    <!--
    
    function cost_c1_onpropertychange()  {
    	window.document.myform1.B1.click();
    }
    </SCRIPT>
    
    <html>
    <body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
    <form name="myform1" action="process.asp" method="POST">
    <select name="cost_c1" LANGUAGE=javascript onpropertychange="cost_c1_onpropertychange();">
    <option>Choose One</option>
    <option>6200</option>
    <option>6210</option>
    <option>6220</option>
    <option>6230</option>
    </select>
    <input type="submit" name="B1" value = "Go!">
    </form>
    </body>
    </html>
    This must simply be a small syntax error. If anyone can spot it, please let me know!!

    Thanks

    dvst8
    Secret to long life:
    Keep breathing as long as possible.

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Try This!

    Code:
    <html>
    <head>
    <SCRIPT LANGUAGE=javascript>
    <!--
    
    function submitIt(){
    
    document.myform1.submit()
    }
    -->
    
    </SCRIPT>
    </head>
    
    <body background="/images/bground.gif" bgcolor="#ffffff" text="#000000" marginheight="0" topmargin="0">
    <form name="myform1" action="process.asp" method="POST">
    <select name="cost_c1" onchange="submitIt();">
    <option>Choose One</option>
    <option>6200</option>
    <option>6210</option>
    <option>6220</option>
    <option>6230</option>
    </select>
    <input type="submit" name="B1" value = "Go!">
    </form>
    </body>
    </html>
    Mark
    -------------------

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    thanks!

    works perfectly mark. thank you much!

    any idea why my code didn't work in netscape?!

    /d8
    Secret to long life:
    Keep breathing as long as possible.

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    I suspect that ID=clientEventHandlersJS is another IE only thing.
    Mark
    -------------------

Posting Permissions

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



Click Here to Expand Forum to Full Width