SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Zealot akohl's Avatar
    Join Date
    May 2001
    Location
    Israel
    Posts
    184
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    cancell form submit for netscape and opera

    How do I cancell a form submit in java script for netscape and Opera?
    The following works for ie only.

    Code:
    function validate()
    {
    
    	window.alert("your form won't be submitted")
    	window.event.returnValue=false
    }
    
    
    <form name="form1" method="post" action="page.asp" onsubmit="validate()">

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this will work in either browser:
    function validate()
    {

    window.alert("your form won't be submitted")
    return false;
    }


    <form name="form1" method="post" action="page.asp" onsubmit="return validate()">

  3. #3
    SitePoint Zealot akohl's Avatar
    Join Date
    May 2001
    Location
    Israel
    Posts
    184
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    thanks

    Looks great. I'll try it. Thanks.


Bookmarks

Posting Permissions

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