Skip to Content
author's profile photo Former Member
Former Member

Skiping lines of code

Hi,

I want to skip some code without using <b>if case</b>, when certain condition meets,

I also want to use client side validations for password retyping using onClientclick, but after completing this itÂ’s again goes to server side processing. Here my question is how to stop calling server BSP after client side validation.

Regards,

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2005 at 09:34 AM

    thanz Ravikiran.C for ur reply,

    In JavaScript function how to get false return if condition not meet ?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      This sample code will solve your problem. Have look over it.

      <%@page language="abap" %>
      <%@extension name="htmlb" prefix="htmlb" %>
      <head>
      <script language="javascript">
      function ValidateForm()
      {
      var txt1,txt2;
      txt1 = document.getElementById("if01");
      txt2 = document.getElementById("if02");
      alert(txt1.value);
      alert(txt2.value);
      if (txt1.value != txt2.value)
      {
       alert("Your passowrds should match");
       return false;
      }
      else
      return true;
      }
      </script>
      </head>
      <htmlb:content design="design2003" >
        <htmlb:page title="Test page to check password " >
          <htmlb:form id="form1" >
            <htmlb:textView text   = "Enter PassWord"
                            design = "EMPHASIZED" />
            <htmlb:inputField id   = "if01"
                              type = "string"
                              size = "20" />
            <br>
            <htmlb:textView text   = "Re-enter PassWord"
                            design = "EMPHASIZED" />
            <htmlb:inputField id   = "if02"
                              type = "string"
                              size = "20" />
            <br>
            <htmlb:button id            = "but01"
                          onClick       = "myEvent"
                          design        = "EMPHASIZED"
                          onClientClick = "if(!ValidateForm(this))htmlbevent.cancelSubmit=true;"
                          text          = "Check" />
          </htmlb:form>
        </htmlb:page>
      </htmlb:content>

      Thanks & Regards,

      Ravikiran.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2005 at 11:01 AM

    ok that really worked, i was looking for this only.

    one more doubt please, how to skip code of lines in OnInputProcessing, let say if i got error in any of function module then it should skip entire OnInputProcessing processing.

    Regards

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2005 at 08:27 AM

    Hi Bhupendra,

    You can perform Client Side Validations you can use JavaScript. In your case of validating password, you can go for validating using JavaScript and calling the JavaScript on button Click. See this code:

    <htmlb:button id    = "but01"
          onClick       = "Sales Order"
          design        = "EMPHASIZED"
          onClientClick = "if(!ValidateForm(this))htmlbevent.cancelSubmit=true;"
          text          = "Test Button" />

    Using this if the entered password is wrong the script checks for it and cancels the server side event.

    Regards,

    Ravikiran.C

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.