Skip to Content

Disable Page validation for a specific button in a form

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 06, 2006 at 06:01 AM

    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

    Add comment
    10|10000 characters needed characters exceeded