Skip to content

Commit 86397cb

Browse files
Update web-forms.js
Better identification of the PostBack method in submit type inputs.
1 parent e8f9941 commit 86397cb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

web-forms.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function cb_SetPostBackFunctionToSubmit(obj)
3838
return;
3939
}
4040

41-
if (!OnClickAttr.Contains("PostBack(this)"))
41+
if (!OnClickAttr.ContainsNameWithSpliter("PostBack", ';', '('))
4242
if (OnClickAttr.charAt(OnClickAttr.length - 1) == ';')
4343
InputElement.setAttribute("onclick", OnClickAttr + "PostBack(this)");
4444
else
@@ -1254,6 +1254,11 @@ String.prototype.ContainsWithSpliter = function (Text, Spliter)
12541254
return (Spliter + this + Spliter).indexOf(Spliter + Text + Spliter) !== -1;
12551255
};
12561256

1257+
String.prototype.ContainsNameWithSpliter = function (Text, Spliter, SpliterNameValue)
1258+
{
1259+
return (Spliter + this + SpliterNameValue).indexOf(Spliter + Text + SpliterNameValue) !== -1;
1260+
};
1261+
12571262
String.prototype.Replace = function (SearchValue, ReplaceValue)
12581263
{
12591264
var MainText = this;

0 commit comments

Comments
 (0)