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

Question

Question

How to auto fill a field when the form is submitted?

asked on July 4, 2018

Hi all,

 

In my form, I have a collection and inside this collection, I have a field.

 

When the form is submitted and if the field is empty, I want to auto populate this field before to save it to LF.

If this field is not emtpy, I juste save it to LF.

 

In my mind, I can do this using Javascript but idk how to do.

Someone for helps plz.

Thanks in advance.

Regards

0 0

Replies

replied on July 4, 2018

i've manged in the past to do it with the "$('.Submit').click(function()" function.

The code below should help you out.
 

Just replace the .complement by the CSS class of your field

$(document).ready(function () { 
 $('.Submit').click(function() {
  if ($('.complement input').val()==""){
   $('.complement input').val('something');
  }
 }); 
});

Hope this helped.

Regards.

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

Sign in to reply to this post.