Bug 42662: Values of disabled form elements should not be submitted; r=kmcclusk

git-svn-id: svn://10.0.0.236/trunk@75557 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
pollmann%netscape.com
2000-08-03 23:32:02 +00:00
parent 2b0d3efc1d
commit 7db58c7c36
17 changed files with 95 additions and 17 deletions

View File

@@ -41,14 +41,18 @@ nsGfxButtonControlFrame::IsSuccessful(nsIFormControlFrame* aSubmitter)
{
PRInt32 type;
GetType(&type);
PRBool successful = PR_TRUE;
if ((NS_FORM_INPUT_HIDDEN == type) || (this == aSubmitter)) {
// Can not use the nsHTMLButtonControlFrame::IsSuccessful because
// it will fail it's test of (this==aSubmitter)
nsAutoString name;
return (NS_CONTENT_ATTR_HAS_VALUE == GetName(&name));
PRBool disabled = PR_FALSE;
nsFormControlHelper::GetDisabled(mContent, &disabled);
successful = !disabled && (NS_CONTENT_ATTR_HAS_VALUE == GetName(&name));
} else {
return PR_FALSE;
successful = PR_FALSE;
}
return successful;
}
PRInt32