1
0
-1

Hi
I am using Joget V6 community version.
My requirement is to add/remove text fields dynamically .
So i have used custom HTML and used following code. But it is not saving to database.
Could anyone help me on this.

<div class="container1">
<button class="add_form_field">Add New Field &nbsp; <span style="font-size:16px; font-weight:bold;">+ </span></button>
<div><input type="text" name="mytext[]"></div>
</div>

And in another custom HTML i have used javascript

<script type="text/javascript">
$(document).ready(function() {
        var max_fields      = 10;
        var wrapper         = $(".container1");
        var add_button      = $(".add_form_field");
        var x = 1;
        $(add_button).click(function(e){
            e.preventDefault();
            if(x < max_fields){
                x++;
                $(wrapper).append('<div><input type="text" name="mytext[]"/><a href="#" class="delete">Delete</a></div>'); //add input box
            }
      else
      {
      alert('You Reached the limits')
      }
        });
        $(wrapper).on("click",".delete", function(e){
            e.preventDefault(); $(this).parent('div').remove(); x--;
        })
    });
    </script>

But this is creating fields properly and upon submitting it is showing as "Form submitted' But table is not created 

 

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hey gb,

      Try using a JDBC binder as your store binder to handle storage of new fields in your Form.

       

      1. gb

        Thank you..

      CommentAdd your comment...