[Mono-bugs] [Bug 76974][Wis] New - Can't set custom JavaScript handler in Form-tag

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 13 04:25:47 EST 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by dfreund at runlevel-5.org.

http://bugzilla.ximian.com/show_bug.cgi?id=76974

--- shadow/76974	2005-12-13 04:25:47.000000000 -0500
+++ shadow/76974.tmp.13437	2005-12-13 04:25:47.000000000 -0500
@@ -0,0 +1,76 @@
+Bug#: 76974
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: gonzalo at ximian.com                            
+ReportedBy: dfreund at runlevel-5.org               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Can't set custom JavaScript handler in Form-tag
+
+Can't set a custom JavaScript handler in the form tag of a web form.
+This happens if the form has some controls that are validated via an ASP
+validation control that uses JavaScript.
+The example below shows the JavaScript alert box on MS.NET and Mono up to
+1.1.8 I guess.
+
+Steps to reproduce the problem:
+1. create a web form and set a custom onSubmit-handler either in the form
+tag in code behind
+2. add a control (e.g. TextBox) to the form
+3. add a validation control to the form
+
+Actual Results:
+When testing the custom JavaScript handler is not called anymore in Mono 1.1.10
+
+Expected Results:
+The custom onSubmit handler should be executed like in MS.NET and Mono < 1.1.8
+
+Reason:
+Mono 1.1.10 adds the JavaScripts for form validation as an onSubmit handler
+to the form tag. MS.NET sets an onClick handler for every control to
+validate. If a custom handler is added in MS.NET the code is appended to
+the ASP generated function calls of the validation handler
+
+Mono 1.1.10 adds a second onsubmit-attribute to the form tag which is
+silently ignored by firefox
+
+
+How often does this happen? 
+every time.
+
+Additional Information:
+Test ASP:
+The page should open the JavaScript alert box every time you hit the button.
+
+<%@ Page Language="C#" %>
+<html>
+<head>
+	<title>Test</title>
+	<script language="javascript">
+	function myOnSubmitJS() {
+		alert("Custom onSubmit()");
+	}
+	</script>
+</head>
+<body>
+
+<form onSubmit="myOnSubmitJS()" runat="server">
+	<asp:TextBox id="someTextField" runat="server" />
+	<asp:RequiredFieldValidator runat="server" 
+		ControlToValidate="someTextField" 
+		ErrorMessage="This overwrites my custom OnSubmit">*
+	</asp:RequiredFieldValidator>
+	<asp:Button id="button" Text="Go!" runat="server"/>
+</form>
+
+</body>
+</html>


More information about the mono-bugs mailing list