Closed
Bug 360249
Opened 18 years ago
Closed 18 years ago
Event submit is not catched by added eventListener when form is submited via document.getElementById('frm_id').sumit()
Categories
(Firefox :: General, defect)
Tracking
()
People
(Reporter: george_ivanov_bg, Unassigned)
Details
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20060601 Firefox/2.0 (Ubuntu-edgy)
1. I attach eventListener to listen for form submition.
2. I one click the submit button, the event is catched .
3. If i click on link that submits the form like this :
onclick=document.getElementById('frm_id').submit() then the event is not catched, thisway skipping validation.
Reproducible: Always
The code :
validator = new Validator(form_id');
validator.addRequired('RegionID','LabelRegionID')
Event.observ('form_id','submit',
function(e){
validator.validate(e)
}
,false);
The observer :
var Event = new Object();
Event.observ = function(element, name, observer, useCapture)
{
var element = document.getElementById(element);
if (element.addEventListener) {
element.addEventListener(name, observer, useCapture);
} else if (element.attachEvent) {
element.attachEvent('on' + name, observer);
}
}
Comment 1•18 years ago
|
||
*** This bug has been marked as a duplicate of 45190 ***
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•