Fire the OnSubmit event on the form not the input field...

git-svn-id: svn://10.0.0.236/trunk@16911 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
1998-12-28 21:28:53 +00:00
parent dbbb4b4485
commit f8bbc3023a
2 changed files with 24 additions and 10 deletions

View File

@@ -208,11 +208,18 @@ void
nsTextControlFrame::EnterPressed(nsIPresContext& aPresContext)
{
if (mFormFrame && mFormFrame->CanSubmit(*this)) {
nsEventStatus mStatus = nsEventStatus_eIgnore;
nsEvent event;
event.eventStructType = NS_EVENT;
event.message = NS_FORM_SUBMIT;
mContent->HandleDOMEvent(aPresContext, &event, nsnull, DOM_EVENT_INIT, mStatus);
nsIContent *formContent = nsnull;
mFormFrame->GetContent(formContent);
if (nsnull != formContent) {
nsEvent event;
nsEventStatus status = nsEventStatus_eIgnore;
event.eventStructType = NS_EVENT;
event.message = NS_FORM_SUBMIT;
formContent->HandleDOMEvent(aPresContext, &event, nsnull, DOM_EVENT_INIT, status);
NS_RELEASE(formContent);
}
mFormFrame->OnSubmit(&aPresContext, this);
}