Jump to content

Check Yes/No based on other fields in report


Recommended Posts

Is there a way to automatically check a yes/no box if another field has data in it? For example I have a yes/no if a shift is complete I would like it switched to yes once the end hrs has data.  I need to be able to do this in a report though if possible because of the way I have it set up.  I'm thinking it will be javascript but not sure how to do it.

 

Thanks

Link to post
Share on other sites
16 hours ago, mdav20 said:

Is there a way to automatically check a yes/no box if another field has data in it? For example I have a yes/no if a shift is complete I would like it switched to yes once the end hrs has data.  I need to be able to do this in a report though if possible because of the way I have it set up.  I'm thinking it will be javascript but not sure how to do it.

 

Thanks

Hi,

I would recommend checking length of the value. You may insert the following script in the footer of details datapage:

<script>

window.onload= function()
{
if (document.getElementById("EditRecordYour_field").value.length>1)
{
document.getElementById("EditRecordcheck_box_field_name").checked=true;
}
}
</script>

Don't forger to change fields names in my script

Cheers!

Link to post
Share on other sites

Hi mda20,

Try the code below and add it to the header of the Details page. As always, change the field names as needed:

<script>
window.onload= function()
{
if (document.getElementById("EditRecordComments").value.length>0)
{
document.getElementById("EditRecordYesNo").checked=true;
}
else if (document.getElementById("EditRecordComments").value.length==0)
{
document.getElementById("EditRecordYesNo").checked=false;
}
}
</script>

Link to post
Share on other sites
On 5/10/2017 at 11:57 AM, mdav20 said:

Thanks for the information, I can't seem to get it to work still.  Should I type out the field names and leave the ( ) or should I use the drop down list to select the field and type of field which adds the [ ]

 

Thanks again

You need to insert your field names after EditRecord, for example if your field name is Status, the syntax will be: ("EditRecordStatus"). More information can be found here.

Please note, Java Script is case sensitive.

Hope that helps.


 
Link to post
Share on other sites

Thank you guys for your help, I've tried both and just can't seem to get it to work.  Maybe because this report is receiving parameters that's why I'm struggling? I might have to just hope the users can follow directions and check the box themselves.

 

 

6 hours ago, Mathilda said:

You need to insert your field names after EditRecord, for example if your field name is Status, the syntax will be: ("EditRecordStatus"). More information can be found here.

Please note, Java Script is case sensitive.

Hope that helps.



 

 

On 5/12/2017 at 5:05 PM, phenom94 said:

Hi mda20,

Try the code below and add it to the header of the Details page. As always, change the field names as needed:

<script>
window.onload= function()
{
if (document.getElementById("EditRecordComments").value.length>0)
{
document.getElementById("EditRecordYesNo").checked=true;
}
else if (document.getElementById("EditRecordComments").value.length==0)
{
document.getElementById("EditRecordYesNo").checked=false;
}
}
</script>

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...