Appnitro Software Forums » MachForm

Extend the Form Properties tab

(4 posts)

  1. Hello Yuniar.

    I'm trying to extend the Form Properties tab of edit_form.php, to add another checkbox below "Limit One Entry Per User".

    For example, it would be called "Verify info".

    What I've done is:
    * Added a field on the ap_forms table (called it form_verifyinfo).
    * Added markup, js and php in edit_form.php
    `
    $form->verifyinfo = $row['form_verifyinfo'];

    </code>
    (...)
    <code>

    <input id="form_verifyinfo" class="checkbox" value="" tabindex="7" type="checkbox"
    onclick="if (this.checked){ update_form('1', 'verifyinfo')} else {update_form('0', 'verifyinfo')};"
    <? if ($form->verifyinfo == 1){ echo 'checked';} ?>>
    `

    As you can see, I'm doing update_form('1', 'verifyinfo')...

    I also tried adding this manually into main_form (by adding onload main_form['data']['verifyinfo']=1;)

    But it doesn't get into the DB... What am I missing? Having a non-obfuscated version of the JS would help, but I can see you have your reasons for doing that :)

    Posted 10 months ago #
  2. (btw I did my best to format the code, but not having a preview it got a bit messed up, sorry about that!)

    Posted 10 months ago #
  3. Hello manuel,

    I'm sorry, but to extend the form properties you will need to modify the javascript indeed. Which unfortunately being obfuscated for a reason :(

    One idea for this would be setting up an onClick event to your "Verify" checkbox.
    So whenever your checkbox is checked/unchecked it sends ajax request silently in the background to modify ap_forms table.

    Posted 10 months ago #
  4. Yuniar, hi, and thanks for clarifying this.
    Seems that's what we'll have to do :)
    - Manuel

    Posted 10 months ago #

RSS feed for this topic

Reply

You must log in to post.