Signature - How to toggle required /...
The signature element lacks the ability to use display rules as is available in most other elements. I was able to manually add the desired rules to both validation_data.js and form.cfg.php. Based on a radio button element in the form, the signature pad can then be shown or hidden as required. However when hiding the signature element, it is itself still a required field and prevents Submit from executing. If you show the signature pad, draw a point, then hide and Submit, it works. I would like to either pre-draw programmatically with a static value based on another element (https://thomasjbradley.github.io/signat … ature.html) or be able to set to a non-required state. What is the appropriate javascript object in the form builder code needing manipulation to accomplish this? Would like to attach to the onChange event of another element on the form (like the radio button). The data_validation string in validation_data.js contains the sigpad attributes but is represented as a json string versus the actual live json object following initialization.
Hi Ken,
If you want to use another inputs value as a prefill then why not use a text input?
If you want to use another inputs value as a prefill then why not use a text input?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
The use case is such that the form input is repeated multiple times per session, with a signature needed only on the last submission (think of this more as a data entry form than a single request type form). The pre-pop is only to get around the fact that Submit is held by the "required" state of the sigpad. I need to be able to submit with the sigpad in a hidden state.
What elements value do you want to place in the signature? Can you share a link to your form?
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
Presenting the live form will be challenging as it is inside protected space. Possibly I can provide a mock-up to illustrate but I don't think we are quite connecting on the issue yet.
As an example, if I have a form with 4 fields, all required, and I have a display rule setup for item #4 (text field) that is dependent on a choice made in item #3 (dropdown). If I select "Choice1" then display item #4. If I select "Choice2", then hide item #4. Based on my selection in item #3 of "Choice2", item #4 will not displayed, however, I am still able to submit the form.
Now replace item #4 with a signature element. Set the "Signature" attribute to "Enabled" in FB. Now the form cannot be submitted until something is in the signature. If you set the Signature attribute to "None", the signature is no longer displayed and the form can be submitted.
Essentially, because display rules are not provided for the signature element (the best solution of course), I need to be able to programmatically toggle the "Signature" attribute to "Enabled" or "None". By other means, this is what I was able to accomplish by manually adding the display rules that are not available within FB itself for a Signature element. But, the required state still remains as "required" so the form cannot be submitted with the signature in a hidden state.
As an example, if I have a form with 4 fields, all required, and I have a display rule setup for item #4 (text field) that is dependent on a choice made in item #3 (dropdown). If I select "Choice1" then display item #4. If I select "Choice2", then hide item #4. Based on my selection in item #3 of "Choice2", item #4 will not displayed, however, I am still able to submit the form.
Now replace item #4 with a signature element. Set the "Signature" attribute to "Enabled" in FB. Now the form cannot be submitted until something is in the signature. If you set the Signature attribute to "None", the signature is no longer displayed and the form can be submitted.
Essentially, because display rules are not provided for the signature element (the best solution of course), I need to be able to programmatically toggle the "Signature" attribute to "Enabled" or "None". By other means, this is what I was able to accomplish by manually adding the display rules that are not available within FB itself for a Signature element. But, the required state still remains as "required" so the form cannot be submitted with the signature in a hidden state.
Simple mock-up available http://www.cncware.com/fb/index.html . Based on the toggle between "Yes" and "No", the signature element should display or not. When displayed, as it current, a signature is required to Submit. With signature hidden (not currently possible in vanilla FB) the signature would NOT be required and still allow a submit.
Give this a try.
You can either place this code inside a html element in the form builder or add it to the head area after export.
You can either place this code inside a html element in the form builder or add it to the head area after export.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
var jQ = $.noConflict(true);
// version 1
jQ( document ).ready(function() {
jQ("#fb-sigpad_control").hide();
jQ("input[name='signature']").click(function() {
if(jQ(this).val()== "Yes"){
jQ("#fb-sigpad_control").show();
}else{jQ("#fb-sigpad_control").hide();}
});
});
</script>
<script>
var jQ = $.noConflict(true);
// version 1
jQ( document ).ready(function() {
jQ("#fb-sigpad_control").hide();
jQ("input[name='signature']").click(function() {
if(jQ(this).val()== "Yes"){
jQ("#fb-sigpad_control").show();
}else{jQ("#fb-sigpad_control").hide();}
});
});
</script>
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
Thanks!
Added that code to the mock-up, which does hide & show as expected, however when hidden the form still refuses to submit as b4, unless you add a signature b4 hiding. So, same behavior. The signature is still a required field whether shown or hidden, and prevents the submit when hidden.
Added that code to the mock-up, which does hide & show as expected, however when hidden the form still refuses to submit as b4, unless you add a signature b4 hiding. So, same behavior. The signature is still a required field whether shown or hidden, and prevents the submit when hidden.
It doesn't appear to be easy to undo the required of the signature. I would take a look at redirecting to another form or using outside files for the sig.
http://ericrohloff.com/coffeecup/ccforu … er/inksig/
http://ericrohloff.com/coffeecup/ccforu … er/inksig/
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
It's easy to overlook something you're not looking for.
This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.