Jump to content

Disable/Hide Submit Button when record is checked


Recommended Posts

I have a field called LockStatus that I do not display on the form (it gets checked somewhere else).  If it is checked then I want to hide the update button.  This is the code I'm using, however the update button refuses to hide.

 

<script>
if (document.getElementById("EditRecordLockStatus").checked){
document.getElementById("Mod0EditRecord").style.display="none";
}
</script> 

 Am I doing something wrong?

Link to post
Share on other sites
  • 1 month later...
On 12/30/2016 at 5:45 PM, bensminger said:

I have a field called LockStatus that I do not display on the form (it gets checked somewhere else).  If it is checked then I want to hide the update button.  This is the code I'm using, however the update button refuses to hide.

 


<script>
if (document.getElementById("EditRecordLockStatus").checked){
document.getElementById("Mod0EditRecord").style.display="none";
}
</script> 

 Am I doing something wrong?

Hi,

I tried your code, it works on my datapage. Make sure that the LockStatus field is editable. If you don't need to display the field, you may hide a field using html blocks

Link to post
Share on other sites
  • 9 months later...

I am trying to Hide the submit button when a virtual field that is a cascading text field (non-editable) equals "0". I've tried different variants of code found here but I still can't seem to get it to work. I am posting it in the footer. This is what I currently have.

<script>
if (document.getElementById("cbParamVirtual2").==0){
document.getElementById("Mod0InsertRecord").style.display="none";
}
</script>

Edited by thompson
named a field wrong
Link to post
Share on other sites
On 11/10/2017 at 9:01 PM, thompson said:

I am trying to Hide the submit button when a virtual field that is a cascading text field (non-editable) equals "0". I've tried different variants of code found here but I still can't seem to get it to work. I am posting it in the footer. This is what I currently have.

<script>
if (document.getElementById("cbParamVirtual2").==0){
document.getElementById("Mod0InsertRecord").style.display="none";
}
</script>

Since this is cascading field, try to get a field value by name, please find an example here

Link to post
Share on other sites
  • 6 months later...
On 12/30/2016 at 10:45 AM, bensminger said:

I have a field called LockStatus that I do not display on the form (it gets checked somewhere else).  If it is checked then I want to hide the update button.  This is the code I'm using, however the update button refuses to hide.

 


<script>
if (document.getElementById("EditRecordLockStatus").checked){
document.getElementById("Mod0EditRecord").style.display="none";
}
</script> 

 Am I doing something wrong?

I am also trying to apply the same logic on a bulk edit webform I need the update button to hide conditionally.  I need to hide the update button when  CorpEOPIDGen is checked (yes) . I'm unable to call the bulk edit  update button to hide it based on the checked logic above. This is what I have so far. 

<script>
if (document.getElementById("EditRecordCorpEOPIDGen").checked){
document.getElementById("Mod0EditRecord").style.display="none";
}
</script>

...also tried 

<script>
if (document.getElementById("BulkEditCorpEOPIDGen").checked){
document.getElementById("Mod0EditRecord").style.display="none";
}
</script>

 

 

I've yet to successfully hide the update button on the bulk edit webform. Any assistance would be appreciated. 

 

Thank you. 

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...