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

Question

Question

How to check a box from a field lookup?

asked on April 10, 2015 Show version history

I asked a similar questions in the link below.

https://answers.laserfiche.com/questions/74362/How-to-check-a-box-once-a-user-fills-out-a-field-or-attaches-a-document-to-a-form#74390

I am able to now populate the checkbox from the signature. 

However, I am needing to store the data for the boxes that are checked in a sql table.

I have been able to fill in the value of the single line item field when the box is checked.

However, I am needing to now know how to populate a checkbox when single line item field is populated by a lookup rule. The problem I have is that when the document loads it immediately run a lookup and checks the box when the field is empty. I am not sure how to get around this.

 

Do you guys have any other ideas? Let me know if I should open another answers forum? 

My code is below.

 
//#q530 is the file upload
//#q567 is the single line item
//var b = 100; 

$('#q530 input').change(function(){
  $('#Field529-1').attr('checked',true);
    $('#q567 input').val(b);
});
 $('#q567 input').change(function() {
   if($('#q567 input').length > 0)
  {
   $('#Field529-1').attr('checked',true);
  }
});

 

   
0 0

Replies

replied on April 13, 2015

Well, I do notice that you are looking at the length of an input which is suspect to me.  Would something like this work better?

$('#q567 input').change(function() {
   if($('#q567 input').val() != '')
  {
   $('#Field529-1').attr('checked',true);
  }
});

If I am mistaken, you can look at the value 

LF.lookup.startingCount on the page.  It gets set to zero after all the lookup rules are completed on page load.

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

Sign in to reply to this post.