This topic is locked
[SOLVED]

Add Custom field to the form

6/5/2021 5:47:08 PM
PHPRunner General questions
C
chandoshi authorDevClub member

I am trying to use the following example for passing a value entered in the import form to "Before Import". I am getting the following error on execution: Input:{"failed":true,"message":""}
I am not sure what you mean by:
Make sure you specify the field ID? Do i need to insert a text field in the form to hold the entered value?


  1. Proceed to the Editor page, switch to the HTML mode and add a custom input field to your form. Make sure you specify the field ID.
    <INPUT id=test type=text>
  2. Add the following code to the JavaScript OnLoad event of the page where the custom field was added:
    this.on('beforeSave', function(formObj, fieldControlsArr, pageObj){
    var val = $("#test").val();
    formObj.baseParams['test'] = val;
    });
  3. In any event like Before record added or Before process use $_REQUEST["test"] to access the custom field value.


admin 6/5/2021

In the following code id of the input box is test:
<INPUT id=test type=text>

The only problem is that this approach won't work with the Import page. There is no form on that page and no beforeSave event. It will only work on Add/Edit pages.