IT Process Automation

 View Only
Expand all | Collapse all

how to create new form element function

  • 1.  how to create new form element function

    Posted Feb 05, 2014 04:17 AM

    how can i create a form element function for making field maindatory



  • 2.  RE: how to create new form element function

    Broadcom Employee
    Posted Feb 05, 2014 08:56 AM

    Fields such as "Select" fields have a "required" flag that allows you to make that field required.

    If you are trying to make a field like the "Text Field" required, you can set the Minimum Length to "1"



  • 3.  RE: how to create new form element function

    Posted Feb 05, 2014 10:21 PM

    Andy thanks for the suggestion, this i already know but i need something like:

    ca_pam_hideField(_id, isHide) which is general function for all form element. this i can use at onchange, onblur and etc. i need something like this for make a field required


  • 4.  RE: how to create new form element function

    Posted Feb 07, 2014 07:09 AM

    I don't think we have that function but a work around would be to call a inline javascript function on onchange or onblur and check the field value, if value is empty then display an alert message .

    To call an inline javascript function  --> ca_fd.js.<function name> . E.g ca_fd.js.getValue()

     



  • 5.  RE: how to create new form element function

    Posted Feb 07, 2014 09:32 AM
    akhan.1:

    Andy thanks for the suggestion, this i already know but i need something like:

    ca_pam_hideField(_id, isHide) which is general function for all form element. this i can use at onchange, onblur and etc. i need something like this for make a field required


    This is a good one to request on the Ideas board!



  • 6.  RE: how to create new form element function

    Posted Feb 10, 2014 11:03 AM

    Hi

    Create two fields, one with the required "true" and one with "false".
    Then, use the hide fields on the one you want to activate / show.



  • 7.  RE: how to create new form element function

    Posted Feb 11, 2014 11:11 PM

    Hello mikaelahby4207719,

    i already tried this, but cannot call Hide Field element function when field status is REQUIRED only can disable the field.

    but when reselect the value it remains disable untill close the IRF and reopen



  • 8.  RE: how to create new form element function

    Posted Feb 12, 2014 03:23 AM

    Hi  akhan. 1

    I use:

    All is set to Requierd "true".
    RadioB "YES"
    onChange:
    ca_pam_disableField('Form.fFnamn', true);
    ca_pam_hideField('Form.fTelenr', false);
    ca_pam_disableField('Form.fTelenr', false);
    onClick:
    ca_pam_hideField('Form.fFnamn', true);

    RaioB "NO"
    onChange:
    ca_pam_disableField('Form.fFnamn', false,);
    ca_pam_hideField('Form.fTelenr', true);
    ca_pam_disableField('Form.fTelenr', true);
    onClick:
    ca_pam_hideField('Form.fFnamn', false);



  • 9.  RE: how to create new form element function

    Posted Feb 12, 2014 11:09 PM
    mikaelahlby4207719:

    Hi  akhan. 1

    I use:

    All is set to Requierd "true".
    RadioB "YES"
    onChange:
    ca_pam_disableField('Form.fFnamn', true);
    ca_pam_hideField('Form.fTelenr', false);
    ca_pam_disableField('Form.fTelenr', false);
    onClick:
    ca_pam_hideField('Form.fFnamn', true);

    RaioB "NO"
    onChange:
    ca_pam_disableField('Form.fFnamn', false,);
    ca_pam_hideField('Form.fTelenr', true);
    ca_pam_disableField('Form.fTelenr', true);
    onClick:
    ca_pam_hideField('Form.fFnamn', false);



    you are using radio buttons. i have two field with drop down one with Choice and other with Member and both are required. i want condition to be as, when choice is "rejected" it wont show members and when choice is approved it shows member field.

    on change i add Disablefield and hidefield, it hides the members field when choice change from approve to reject. but when choice again selected Approve it wont show the members drop down. then i have to close and reopen IRF.

    i need solution which works with select choice like when choice is approve it shows field and when it is rejected it wont show without reopen the IRF.



  • 10.  RE: how to create new form element function
    Best Answer

    Posted Feb 25, 2014 01:06 AM

    Hi all,

    i found a workaround, i careated a validate script which works fine.

     



  • 11.  RE: how to create new form element function

    Posted Feb 25, 2014 01:42 AM

    Hi Khan,

    Are you able to share your solution (workaround) - I think this will be interessting for the community!

    Thanks in advance

    Jürg



  • 12.  RE: how to create new form element function

    Posted Feb 25, 2014 01:57 AM
    juerg_walther:

    Hi Khan,

    Are you able to share your solution (workaround) - I think this will be interessting for the community!

    Thanks in advance

    Jürg


    i have two fields one with Choice "Form.choice"(approve/reject/More Info) and one with Members"Form.Member" (list of users). Task is to make Member field mandatory when choice is Approve.

    i created a validate script with an alert and place it at submit

    "{
      onSubmitValidate :  function (obj) {
        var selectedValue = ca_pam_getSelectedOptionValues(obj);
        var memberValue = ca_pam_getSelectedOptionValues('Form.Member');
        if(selectedValue == 'Approved' && memberValue == ''){
          alert('Please select Implementer');
          return false;
        }
      }
     
    }"
     

    and in form on submit i added

    "ca_fd.js.onSubmitValidate('Form.choice')"

     

    now as defined when condition is approve it gives popup on submit to select implementer, and when condition is false it finish without any popup.

    remember to make "required=false" on field Form.Member.



  • 13.  RE: how to create new form element function

    Posted Feb 25, 2014 03:42 AM

    Khan,

    Thanks again!

    Jürg (Juerg)