CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 10/6/2003 5:10:11 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 4 Views: 436 Favorited: 0 Favorite
5 Items, 1 Pages 1 |< << Go >> >|
vintious
Asp.Net User
Forms onSubmit() method not called when submit() invoked10/6/2003 5:10:11 PM

0

I have a control that adds a method to the onSubmit event handler of the form. The JavaScript function runs when I click a ASP.NET Button Server control, because it's an actual submit button. The problem comes with things such as ASP.NET LinkButtons and other controls that call the __doPostBack() JavaScript method. The __doPostBack() method invokes the form's submit() method, however the onSubmit event handler isn't being called.

Any solutions?
Andy Smith
Asp.Net User
Re: Forms onSubmit() method not called when submit() invoked10/6/2003 7:36:08 PM

0

well, you might be able to actually overwrite the the form's submit() function to call the onsubmit event...
something like this:
function MakeFormSubmitRaiseOnSubmit() {

for( var i = 0; i < document.forms.length; i++ ) {
var theForm = document.forms[i];
theForm.originalSubmit = theForm.submit;
theForm.submit = function() {
if ( this.onsubmit ) {
if ( this.onsubmit() != false ) {
this.originalSubmit();
}
} else {
this.originalSubmit();
}
};
}
}


this is just off the top of my head. I have no idea if it will work or what problems it may cause. Use at your own risk.
vintious
Asp.Net User
Re: Forms onSubmit() method not called when submit() invoked10/8/2003 11:20:24 PM

0

I need some way to change the __doPostBack() method that is inserted on each page, but I need to be able to do that from my class, rather than the page my control is used on.

Any way to do this? The method above doesnt exist in my class (inheriting from System.Web.UI.WebControls.TextBox)

Thanks
Andy Smith
Asp.Net User
Re: Forms onSubmit() method not called when submit() invoked10/8/2003 11:59:25 PM

0

the javascript I posted would change the actual submit method on the form. This would make the .submit() call in __doPostBack do something different, to whatever you want.

The only way to change the __doPostBack method would be to render the page into a string, alter the string, and then emit that to the browser. I don't generally suggest people do that.
vintious
Asp.Net User
Re: Forms onSubmit() method not called when submit() invoked10/9/2003 12:09:03 AM

0

Yeah I saw a solution that had to do with that but I decided against it.

Where would I put that code you posted? I need some way of doing this inside my class.
5 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
JavaScript: the definitive guide Authors: David Flanagan, Pages: 994, Published: 2006
JavaScript Bible Authors: Danny Goodman, Michael Morrison, Brendan (FRW) Eich, Pages: 1173, Published: 2007
The book of JavaScript: a practical guide to interactive Web pages Authors: Thau, Pages: 490, Published: 2006
JavaScript and DHTML Cookbook: Solutions and Example for Web Programmers Authors: Danny Goodman, Pages: 520, Published: 2003
ASP.NET AJAX programmer's reference with ASP.NET 2.0 or ASP.NET 3.5 Authors: Shahram Khosravi, Pages: 1522, Published: 2007

Web:
Why is referencedata not called after form submit - Spring ... On submit of this form, the application takes him to the success view. ... to submit page (the same page) the reference data is not invoked ... Once your validations are successful, the onSubmit method will be processed. ...
form.submit() not firing onSubmit calls - Ruby Forum The problem arises when I try to submit the form through javascipt with $(form). submit();. When this happens it does ... That is correct, submit observers are not called when you call form.submit(). ... $('my-form').onsubmit() Think of it as a named method just waiting to be invoked. -justin ...
Javascript: onsubmit() function is not called with Firefox ... The one important difference between the submit() method and form ... the user is that the onsubmit() event handler is not invoked when submit() is called. ...
Form - onsubmit handler - test which submit button is activated ... There isn't a provided method for that. ... I almost feel like the onclick function is not invoked for this submit button..... but the form's onsubmit handler is invoke directly. ... The submit button's onclick event handler is called before the onsubmit hanlder of the form. The reason it was not ...
JAVASCRIPTS :: Onsubmit() Vs Submit() Function Not Called From Onsubmit Code; Placing Value In Hidden Input Onsubmit .... i'm trying to make unchanged fields in a form not submit, it's an order ... I just noticed that if I use a "submit" button the "onSubmit" function call will be invoked. .... They all use the "onsubmit" verification method e.g.

Forms onSubmit() method not called when submit() invoked - ng.asp ... Forms onSubmit() method not called when submit() invoked, > ROOT > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum, Date: 10/6/2003 5:10:11 ...
NukeSyndicate 4 released (open source rich media casting module ... forms onsubmit() method not called when submit() invoked ยท i use godaddy for my hosting, but i can't connect remotely with visual web developer ...






vs 2005 options not saved

asp.net/vb.net is extremely slow

need a good "version control software"

vs 2005 problem: project requires a unique name.

vs2005 built-in web server problem

unstable compilation result !!! sometimes work, sometimes not.

how to bind menu control with dynamic data

vs2005 sp1 problems

compositecontrol descendants do not appear in toolbox - bug?

how do i tell vs 2005 to use iis 6 resides on another machine?

asp.net version mismatch

properties window disabled (gray)

time code execution

why vs 2005 still create web dev server?

the project type is not supported by this installation

problems with error list window on builds

how i can add the windows service to visual studio ide, by means of which i can display the last updated code?

function key?

how to format codes in html editor in vs 2005?

is it possible adding our own keywords to intellisense ?

how to get "intro.css" file ?

where is msavalon namespace

clientscript.registerstartupscript-why pass type?

website, iis and dll

getting access to vsts server using .net,c#

problems usings remote iis option

what is this "iis://localhost/w3svc"

2.0 framework

error type 'system.timers.timer' cannot be serialized over wcf

web deployment project issue: how do i allow updates to various sections in web.config in the target server as part of installation ?

   
  Privacy | Contact Us
All Times Are GMT