Hi,

I want to populate technicians' email in input field based on selected technicians' name from drop down list.

I managed to list out group of technicians' name by using Form Variable which using beanshell plugin.

Can anyone show me how I can display technicians' email in another input field when I select one of the technicians' name in drop down list?

Thanks

  • No labels

3 Comments

  1. I think this is something beyond the capability of the Joget v2 Form Builder. You will need to write your own ajax event handling code on the selection and then to pick up the emails and populating them on the go.

    Also take note that you can put your coding that you wrote in the custom HTML element in the form builder when you finish with your coding.

    Hope it helps.

    1. Hi Hugo,

      Thanks for the reply.

      I do understand that we can put any javascript, ajax or any css style in the CustomHTML.

      But what I do not understand is how we gonna call the function for example Javascript function from Form Builder.

      Let say I created a javascript function to calculate days between date:

      function calcDays() {

        var Start_Date = document.getElementsByName('tech_sdate').value;
        var End_Date = document.getElementsByName('tech_edate').value;

        Start_Date = Start_Date.split("-");
        End_Date = End_Date.split("-");
        var sDate = new Date(Start_Date[0]"/"+Start_Date[1]"/"+Start_Date[2]);
        var eDate = new Date(End_Date[0]"/"+End_Date[1]"/"+End_Date[2]);
        var daysApart = Math.abs(Math.round((sDate-eDate)/86400000));
        document.getElementsByName('test').innerhtml = daysApart;
       }

      1) How we gonna call function calcDays() in Form Builder?

      2) Do we need specific API to call the function?

      3) What is function formbuilderOnReady() for?

      Thanks

      1. 1. I don't really get you. You call the function when you need it? For example if the field tech_sdate or tech_edate changes? Bind onChange event to them.

        2. It's just plain javascript. As explained above.

        3. Please see Sample Custom JavaScript in Form Builder.

        Hope it helps.