cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Page validation for a specific button in a form

former_member182374
Active Contributor
0 Kudos

Hi All,

I have a simple form with two input fields, "Submit" button and "Cancel" button.

The two input fields have SAP validators attached to them.

I want to disable the validators when the user clicks the "Cancel" button.

In ASP I can write:

<script language="JavaScript>

document.all["cmdCancel"].onclick =

new function("Page_ValidationActive=false;");

</script>

(When "cmdCancel" is the ID of the button)

I tried to write the following code in my Portal Component:

cmdCancel.ScriptingEvents("BUTTONCLICK") = "Page_ValidationActive=false;"

I get no JavaScript errors but the validators on the page are still active.

How can I disable the validators when clicking this specific button?

Thanks,

Omri

PDK version 2 ; EP6 SP15

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182374
Active Contributor
0 Kudos

More info:

I tried to call a java script function in the "scripting events" (instead of putting java script code):

cmdCancel.ScriptingEvents("BUTTONCLICK") = "disableValidation()"

and in my html:

<script language=javascript>

function disableValidation() {

Page_ValidationActive = false;

alert("1234");

}

</script>

The alert box is displayed but validation is still active.

How do I disable validation?

(In "classic" ASP .NET there is no problem)

Thanks,

Omri