You are viewing limited content. For full access, please sign in.

Question

Question

Delete rows in table when info passes from one form to another

asked on November 6, 2017

I have a table in a form.  It is possible that it will contain empty rows.  On the next form, I need to gather the data that was entered into the table, but I would like to delete the empty rows automatically.  

Here is my table...

If the event field is empty, I would like the entire row to disappear when the information is passed along to the next form.

I have learned how to delete rows when the user enters information into a field.  For example, if there was a field that said" Delete Rows?"  and "yes" was entered.  I have managed to delete rows in this fashion, but I am unsure how to do it between forms.  I do not want to rely on user input for the deletion.

I welcome any advice/guidance on the matter.

Thanks.

 

 

0 0

Replies

replied on November 6, 2017 Show version history

When the next form is loaded, any javascript you have on that form will run 1 time.  So instead of calling a function on change to the table, just enter the code you want to run on form load. Something like this

$('.yourTableClass tbody tr').each(function() {

      var event = $(this).find('.event input').val();
      if(!event){
                //YOUR DELETE ROW CODE HERE }

});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.