Field validations in HTMLB.

Hi All,
We have  a few issues regarding field validations in HTMLB:
1)We have an editable cell in a tableView of the form.Field validation is done , but we are unable to set the FOCUS on this field aftert displaying the error message.we tried using PHTMLB element focusRect but it dosent works.
2)Thers a radio button group with three radio buttons.How to make selection of a radio button mandatory , similarly how to make selection from a DDLB mandatory in the form?
I guess using java script will be benificial as it prevents server round trips....
Thanks in advance,
Anubhav.

Hi ,
Field validations for DDLBs is done , but i didnt find accurate solution for Radio Button Group...
1)How to check that at least one radio button is selected from the radio button group?
2)How to set focus on DDLB after alert message?
I tried using
dacument.form.elementID.focus( );
But it gives a java script error
Function not suppoeted for the element.
3)How to stop form from submiting after the laert message?
I tried using
return false();
after the message , it works but the IE shows the message
Done but with errors on page
after the OnClientClick is triggered.
and if i use
return false;
, the form is submited....
Thanks,
Anubhav.

Similar Messages

  • Mandatory field validation on Page links.

    We have created a Portal application where we included different applications as taskflows. We have also created a tabbed interface which helps us to communicate from one task flow to another taskflow. When we are in one page of taskflow and try to move to another page of different taskflow using tabbed interface we receive mandatory field validation error which prevents us to move to any other page until we fill all the mandatory fields. We need to move to different page of taskflow by using the tabbed interface even without filling all the necessary mandatory fields. Can anyone help us to resolve this issue as this is very important for our project.

    <b>Layout</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content design="design2003" >
      <htmlb:page title="Check Pernr " >
        <htmlb:form>
          <htmlb:textView text   = "Personnel No."
                          design = "EMPHASIZED" />
          <htmlb:inputField id    = "pernr"
                            value = "<%= lv_pernr %>" />
    <%
    if lv_no_pernr = 'X'.
    %>
    <script language="Javascript">
    alert ("Personnel no. is not Valid")
    </script>
    <%endif.%>
       </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>ONINPUTPROCESSING</b>
    DATA: l_pernr TYPE persno.
      DATA: data TYPE REF TO cl_htmlb_inputfield.
      data ?= cl_htmlb_manager=>get_data( request = runtime->server->request
                                             name     = 'inputField'
                                             id       = 'pernr' ).
      IF data IS NOT INITIAL.
        l_pernr = data->value.
      ENDIF.
    CLEAR lv_no_pernr.
    SELECT SINGLE pernr FROM pa0000 INTO l_pernr WHERE pernr EQ lv_pernr.
    IF sy-subrc NE 0.
      lv_no_pernr = 'X'.
    ENDIF.
    <b>PAGE ATTRIBUTES</b>
    lv_no_pernr     TYPE     FLAG
    lv_pernr     TYPE     PERSNO
    hope this helps.
    A

  • Trying to create a Field Validation Expression and need help

    I have a picklist field and another field that are in question. I want to set some sort of rule that forces the second field to be populated only If specific values are selected from the picklist field.
    I was going the route of a field validation Rule, but everything i've tried so far does not produce the results i am trying to achieve.
    The first type of expression i tried was:
    ([<plProduction_Print_Account_Category_ITAG>] <> LookupValue("OCC_CUST_LOV_ACCOUNT_1", "No Production Print") AND ([<stSIC_Code_ITAG>] IS NULL))
    This is generating the field validation error message when i select any of the correct values from the picklist. the problem is still the second field, which will generate the error if a value is entered into the second field, regardless of the picklist value selected. Switching the "IS NULL" to "IS NOT NULL" only reverses the problem on the second field, causing the error to generate when the second field is updated to a NULL or blank value.
    I also tried :
    = 'No Production Print' AND [<stSIC_Code_ITAG>] IS NOT NULL
    and got similar results.
    ([<plProduction_Print_Account_Category_ITAG>] = LookupValue("OCC_CUST_LOV_ACCOUNT_1", "No Production Print"))
    Similar results as well.
    Does this need to be an IIF statement? Do I need to make this a workflow expression instead? i could really use some help as I have tried everything i can think of and admit, i'm not the expression guru!!!. Any assistance would be appreciated.
    TeknoMan

    Yes we have the same request and we used the following expression. Example we have a field "Método de pago" ( [<plMtodo_de_pago_ITAG<]), it's values are "CHEQUE and DEPOSITO" if we select DEPOSITO three more fields were requiered Route, Sucursal de banco and Clabe so we have to put this validation in the four fields including Metodo de pago.
    [<plMtodo_de_pago_ITAG>] <> "DEPOSITO" OR ([<Route>] IS NOT NULL AND [<nSucursal_de_banco_ITAG>] IS NOT NULL AND [<stCLABE_ITAG>] IS NOT NULL)
    well in the field CLABE we put the following [<plMtodo_de_pago_ITAG>] <> "DEPOSITO" OR ([<Route>] IS NOT NULL AND [<nSucursal_de_banco_ITAG>] IS NOT NULL AND [<stCLABE_ITAG>] IS NOT NULL AND Len([<stCLABE_ITAG>])=18) this was because the len of the value must be 18 characters.
    I hope this works for you
    Regards Catalina Valadez
    Edited by: CatalinaV on 12/03/2009 10:54 AM
    Edited by: CatalinaV on 12/03/2009 10:55 AM

  • How to insert check box fields in a htmlb: tableview

    Hi,
    Can anybody tell me how to insert check box fields in a htmlb: tableview in a sequence of rows in a table view. How to generate the sequence no for the checkbox inorder to know the row that is checked.
    Thanks in advance,
    Aruna.

    Here is the code which has the custom "Checkbox" in the tableview & Triggers the event. <b>You can identify the checkbox based on cell ID (p_cell_id)</b> in the method "IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START" & Based on the event name + Cell ID. Look at the code & let me know if you any issue.
    <b>Layout:</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content id               = "content"
                   design           = "design2002+design2003"
                   controlRendering = "SAP"
                   rtlAutoSwitch    = "true"
                   forceEncode      = "ENABLED" >
      <htmlb:page title="Test " >
        <htmlb:form>
          <%
      data TV_ITERATOR Type Ref To zcl_itr.
      data iterator type ref to IF_HTMLB_TABLEVIEW_ITERATOR.
      create object tv_iterator exporting appl_cons = application.
      iterator = tv_iterator.
          %>
          <htmlb:tableView id              = "fligts"
                           headerText      = "Flight"
                           width           = "100"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "10"
                           fillUpEmptyRows = "true"
                           showNoMatchText = "true"
                           filter          = "server"
                           sort            = "server"
                           onHeaderClick   = "MyEventHeaderClick"
                           table           = "<%= APPLICATION->itab %>"
                           iterator        = "<%= ITERATOR %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>Event Handling:</b>
    DATA: EVENT_ID1 TYPE REF TO IF_HTMLB_DATA.
    EVENT_ID1 = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
    CASE EVENT_ID1->EVENT_SERVER_NAME.
    IF NOT event_id1 IS INITIAL.
       if event_id1->server_event+0(9) = 'chkevent'.
      SPLIT event_id1->server_event AT '-' INTO v_event v_dummy v_row v_col.
      endif.
    endif.
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
         CLEAR p_column_definitions.
        CLEAR p_overwrites.
        DATA: tv_column  TYPE TABLEVIEWCONTROL.
        tv_column-COLUMNNAME  = 'FLDATE'.
        tv_column-edit        = 'X'.
        tv_column-sort        = 'X'.
        tv_column-TITLE               = 'Flight Date'.
        tv_column-WIDTH  = '100'.
        APPEND tv_column TO p_column_definitions.
        CLEAR tv_column.
        tv_column-edit        = 'X'.
        tv_column-COLUMNNAME          = 'CONNID'.
        tv_column-TITLE               = 'Conn.ID'.
        tv_column-WIDTH  = '70'.
        tv_column-HORIZONTALALIGNMENT = 'center'.
        APPEND tv_column TO p_column_definitions.
        CLEAR tv_column.
        tv_column-edit        = 'X'.
        tv_column-COLUMNNAME          = 'CHECKBOX1'.
        tv_column-TITLE               = 'Check Box'.
        tv_column-WIDTH  = '30'.
        tv_column-HORIZONTALALIGNMENT = 'center'.
        APPEND tv_column TO p_column_definitions.
    endmethod.
    METHOD IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
           DATA: L_EVENT TYPE STRING.
      CASE P_TABLEVIEW_ID.
        WHEN 'fligts'.
          CASE P_COLUMN_KEY.
            WHEN 'CHECKBOX1'.
    *          CONCATENATE 'chk_event' '123' '2323' INTO L_EVENT SEPARATED BY '-' .
    CONCATENATE 'chkevent' p_cell_id INTO l_event SEPARATED BY '-'.
              P_REPLACEMENT_BEE = CL_HTMLB_CHECKBOX=>FACTORY( ID = P_CELL_ID
            ONCLICK = L_EVENT CHECKED = 'false' ).
          ENDCASE.
      ENDCASE.
    ENDMETHOD.
    Hope this will solve your problem.
    <b><i>* Reward each helpful answer.</i></b>
    Raja T
    Message was edited by:
            Raja T

  • How can I do field validation on the last two characters of a text field?

    I have a text field. The user is required to enter the last two characters as numbers. I want to apply validation on this field. How can i achieve the same?
    EX: If the user enter ABCDE, an error messgae stating the last two digit should be numeric.
    I tried using the below in the field validation which did not work.
    (0+Right([<ExternalSystemId>],2)) > 0 AND (0+Right([<ExternalSystemId>],2)) < 99.
    Any ideas would help?

    Try this-
    FindOneOf(Right([<Field1>],"2"),"abcdefghijklmnopqrstuvwxyz")=0
    rgds,
    Amit

  • Field Validation on Read Only Field

    I'm trying to create a pop up error box if a field contains null values. The problem is that the field I'm trying to do the validation on is a read-only field. It's the Account field on the Contact Object or Module. It won't allow me to include validation. The goal here is to have a POP UP ERROR box come up if someone does not select a value for that field. Making it required doesn't generate a popup box, it only has a small "required" text next to the field which can be easily missed by a user. Any ideas?

    Hi !
    I found the way to do what you wan't, but it sounds a bit strange for me...
    You have to put a field validation on the Account Id field. I made some tests to know what is in the AccountId field when it's blank and i see that the value is "No Match Row Id" !!
    So your validation rule must be simply
    *&lt;&gt; "No Match Row Id"*
    It worked for me, the error message appears... But I think this is something we have to report to Oracle...
    Hope this will help, feel free to ask more !
    Max

  • Field validation - make field required based on value of another field

    Hi,
    I tried to enter the field validation into both LeadSource and stSource_Detail field, however, when the LeadSource is not "Customer" or "Staff" and Source Detail is not empty, the validation message will prompt. Below is my field validation:
    IIf(([<LeadSource>]=LookupValue("OCCAM_LEAD_SOURCE", "Customer") OR [<LeadSource>]=LookupValue("OCCAM_LEAD_SOURCE", "Staff")) AND [<stSource_Detail_Staff_ID__Customer_ID_ITAG>] IS NULL,N,[<stSource_Detail_Staff_ID__Customer_ID_ITAG>])

    Field Validation statements must return only TRUE or FALSE. Rewrite your statement such that if your condition is valid, true is returned, and if not, false is returned.
    Thom

  • Field Validation on Custom Obj. 4:  Value of one field making other Req.

    Hello All,
    I have been working on a field validation problem for a while. I have a custom Picklist on CO4. This picklist has two values YES and NO (a checkbox does not meet requirements). What I need to do is If Picklist='YES' then FieldA, FieldB, and FieldC are Required else they are not required. FieldA = Text (short), FieldB = Date, and FieldC = Currency. I've tried numerous ways to validate on Fields A, B, and C with statements like IIf(Picklist=LookupValue(Picklist,"YES"),FieldA<>NULL,FieldA) or IIf(FieldValue(Picklist)="YES",FieldA<>NULL,FieldA) etc... these were just my latest attempts at this point I'm jsut trying random things to try to get it working. I am probably using incorrect syntax (even though it passes the sytax checker). If anyone has any suggestion let me know. Also if I haven't made clear what it is I'm attempting to do let me know and I'll try to clarify.
    Thanks,
    Z

    Hi,
    if I understand correctly, you want this functionality:
    If Picklist = NO => it doesn't matter what values are contained in Field A, B and C.
    If Picklist = YES => Field A is not null and Field B is not null and Field C is not null
    To trigger the validation when the picklist value changes then you have to configure the Field Validation for the Picklist:
    [<Picklist>]=LookupValue("Picklist","NO") OR ( Len([<Field_A>])>0 AND Len([<Field_B>])>0 AND Len([<Field_C>])>0 )
    You have to put the validation also on Field_A and Field_B and Field_C, because in case of an update of , let's say, Field_B, you should prevent that Field_B is blanked.
    If someone updates only Field_B and he doesn't change the value of the Picklist, the validation expression put on the Picklist is not evaluated.
    Simona

  • Name of the table where can get the two fields Valid-From and Valid-to for

    Hi gurus
    I want name of the table where I can get the two fields Valid-From and Valid-To and their relation ship with the header table in BOM
    Regards
    Kaisar

    You can only get the Valid from date from the table STKO.
    To get the valid to date, you have to take one day less than the valid-from date of the next record for the same BOM.
    Alternatively use the Function module:
    CSAP_MAT_BOM_READ
    It will give both valid from and valid to dates in the tables parameter: T_STKO
    Regards,
    Ravi
    Edited by: Ravi Kanth Talagana on Jul 2, 2008 4:37 PM

  • Bypass Required Field Validation when needed in PDF Dynamic Form

    I faced a tricky situation, where some fields are required, but we need to allow bypass required (mandatory) validation rule when saving the form, and require to fill such fields when submitting the form. In other words, provide flexible control when to turn On / Off this feature.
    I wanted to implement a flexible solution, and I will post my findings here. Appreciate your feedback for improvements.
    Steps:
    1. Mark rquired fields as required.
    2. Specify "Empty Message" as "This field cannot be left blank", or similar.
    3. Specify "Validation Script Message" as "This field must have a proper value before submit", or similar.
    4. Create a Global Form Level Variable something like "StopTotalValidation" and default as "1" means by default, Turn Off Validation for some cases.
    5. For the fields which require this type of control, add the script (to be defined later) on the "validate" event:
    myTools.validateForRequiredField(this);
    6. Create a Script Object "myTools" and add the following script:
    function initStringFunc() {
    //call this function on Document Initialize
    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
    String.prototype.ltrim = function() {
        return this.replace(/^\s+/,"");
    String.prototype.rtrim = function() {
        return this.replace(/\s+$/,"");
    String.prototype.isEmpty = function() {
        return (this == null) || this.trim() == "";
    function setNodeProperty(theNode, theProperty, newValue) {
       if (theNode[theProperty] != newValue) {
            theNode[theProperty] = newValue; 
    function isNodePropertyEmpty(theNode, theProperty) {
        var result;
        if (theNode == null || theNode[theProperty] == null) {
            result = true;
        } else {
            result = theNode[theProperty].isEmpty();
        return result;
    function disableTotalValidation() {
        StopTotalValidation.value = "1";
    function enableTotalValidation() {
        StopTotalValidation.value = "0";
    function isTotalValidationOn() {
        return StopTotalValidation.value != "1";
    function isTotalValidationOff() {
        return StopTotalValidation.value == "1";
    const conRequired = "(required)";
    function validateForRequiredField(theFld) {
        // Bypass Required Field Validation when Global Validation is Off.
        var result=false;
        if (theFld) {
            if (theFld.mandatory && theFld.mandatory == "error") {
                if (myTools.isNodePropertyEmpty(theFld, "rawValue")) {
                    myTools.setNodeProperty(theFld, "rawValue", conRequired);
                if (isTotalValidationOn()) {
                    if (isNodePropertyEmpty(theFld, "rawValue") || theFld.rawValue.toLowerCase() == conRequired.toLowerCase()) {
                        result = false;
                    } else {
                        result = true;
                } else {
                    result = true;             
        } else {
            result = false;
        return result;
    7. Now, on the click of "Save" button call the function "disableTotalValidation()" and on the click of "Submit" button call the function "enableTotalValidation()".
    I have just finished implementing the above solution, and as per my initial testing, it is working fine.
    I will post this to my Google Docs workspace, and provide updates their.
    Tarek.

    Hi Tarek,
    I see what you mean in relation to clarity if you used the form variable approach. It was only a suggestion. Like so many things in LC, there is more than one way to finding a solution to a problem.
    The triple equal sign (===) is testing if the condition is equal, but to a higher standard. It is testing if the values are identical to each other. For example if you were testing if a textfield was empty, with Equality (==) you might have this:
    if (this.rawValue == null || this.rawValue == "") {
         // Some script
    If you use Identity (===) you can do the same thing with less script:
    if (this.rawValue === null) {
         // Some script
    It is also useful when testing the value of an object, but also the type (eg string, number, Boolean).
    Lastly, it can be used for non-identity (!==).
    In relation to createNode() etc, apart from John's blog, it is covered in the LC documents: http://www.adobe.com/support/documentation/en/livecycle/documentation.html. Look for the scripting guides and the guide to the XML Form Object Model.
    Good luck,
    Niall

  • Currency field validation

    Hi All,
    For SRM-MDM catalog workflow, I want to write a currency field validation to find out the catalog item data records where difference between the original price and the new price for the same catalog item data is greater than 1%.
    So as a precursor to the final validation expression, I wrote a very primitive validation expression like:
    IF((Contract Price.Amount - [Original].Contract Price.Amount)>1,FALSE,TRUE)
    And I was expecting that this should return a FALSE boolean value whenever difference is greater than 1. But surprisingly, irrespective of the difference in the amount, it always returns a TRUE value.
    I am wondering whether it is a problem with the validation expression or is it a bug? I am working on SAP MDM 5.5 SP04 Patch 02 (5.5.63.71).
    Any suggestions would be appreciated.
    Thanks,
    Satyen

    Hi Nisha,
    Thank you for your reply.
    As I had mentioned in my previous post, irrespective of whether, amount value is incremented or decremented, it always returns FALSE.
    Syntactically and logically, your validation expression is correct but still it always return an error message (a FALSE value).
    What do you reckon, is it a bug in the MDM software?
    Regards,
    Satyen

  • How to "Hide signature field validity icon when signature is valid" in Acrobat 6 Standard?

    I know how to "hide the signature field validity icon" in Acrobat 8 Pro, but just can't seem to find where to do it in Acrobat 6 Standard.
    Thanks for any help!
         .....Sean

    Hi Sean,
    That functionality didn't exist in version 6. I got to tell you though that version 6 is way past its end-of-life and you really should be using a newer version.
    Steve

  • Field Validation

    I have custom picklist (department) which has value like 'Research','Sales','Production'
    If the picklist value is Sales ,Owner field of SR can be null(owner field need not have value),I should be able to save record,
    If picklist value is other than sales ,Owner field of SR should not be null(Owner field should have value),It should prompt msg saying select owner.
    I wrote field validation on departmnet picklist
    IFF((Fieldvalue('<picklistnmae>')<>'Open' AND [<Owner>] IS NULL),True,False)
    but it show error msg for any status...
    how to make owner field require based on picklist value chosen

    Hi,
    I think Owner cannot be null. If Owner is blank, Owner will be set as the person who create the record. Please chck it.
    So the condition might be wrong.

  • Field validation in table maintenance generator and input value grey out.

    i have created ztable with 3 fields as em_no,em_no and addrnumber.
    first two fields are custom fields but the third custom field need to validate the standard table adrc contains the value of the field addrnumber.
    i need the query of field validation query which we write in create entry events in table maintenance generator and also if we give wrong value for addrnumber in sm30 maintain table, the input field need not to be grey out for next entry...
    please help.

    Hi,
    create method -
    >before saving data.....write the logic between the method
    go to utilities->table maintanance ,,,after creating generator ---go to envirnment->modification->events.
    create event -.>.as zsave select event  type 1(before saving data to table) write code in include....
    consider data for field3 is 10 .
    lv_new = ztbr(table name)-field3.
    select field3  from ADRC(ZTABLE) into wa_new (TYPE ZTABLE) where field3 = lv_new.
    if sy-subrc = 0.
         working fine
         else.
        message  i888(sabapdocu) with 'data invalid'.
    endform.
    This will help u...
    Thank u.........

  • Additional field validation

    Hi,
    for example - I have a table element and one of its coloums is of type TIME. The automatic field validation (only valid times allowed) is working fine, but now i need to check that only full and half hours are entered. So if the user enteres "11:11" in a row I want this input-cell to be displayed with a red border and a message to be displayed.
    I can check and show a message, but how to highlight that special cell?
    Can I assign additional value checks to a context node and how to do this?
    Whats the best approach?
    Thanks for any help,
    Stefan.

    Hi Stefan,
    As how pointed out by Karri you can make use of the report_attribute_error_message to throw an error message and highlight a particular cell of the table as well. Try going through this [link|editable ALV - how to throw an error message for a specific line & field; in which Andreas was trying to validate & highlight an ALV's cell with the same report_attribute_error_message.
    Regards,
    Uday
    CALL METHOD lo_message_manager->report_attribute_error_message
              EXPORTING
                message_text   = 'Sample message text'
                element        = lr_element " Reference of type if_wd_context_element to the cell u want to highlight
                attribute_name = ls_modified_cells-attribute. " The context attribute name to which the column of this cell is bound to

Maybe you are looking for

  • Application Web Service Control Manager detected AWEBSVC is not responding to HTTP requests

    Hi, We are using SCCM 2012 sp1 cu5 with one primary in the datacenter and a number of local DP's which are presently servicing 200 users, but will rise to 12,000. The Application Catalogue is installed on the primary server. Once a day we get the abo

  • IMessage on mt lion: can't sign in w/ apple ID

    From time to time, I've been trying to log into iMessage on Mt Lion since I upgraded when Mt Lion was first available.  At first, I was able to log in and use iMessage, but it annoyingly logged me out after every message I sent.  Now I can't log in a

  • SAP HR

    I want to run an audit report (ECC report) which identify the list of new hirers for a particular day for a particular infotype. What ever data fed for the new hirer should be displayed.

  • How do I load digital video to my Storm?

    I was told by the saleperson that the BB Storm can play digital moives and videos that you now get with some Blu-ray DVD movies. So how do I do that? Which format can I load. So far all I get is a request for a license which gets denied when trying t

  • Report output send through mail

    Dear friends, Looking for sample report to send the report output through external mail on execution. Regards, Praveen Lobo