HTML5 Data Bindings Formatter Support Product Page
Answered
'Conditional' 'does not Contain' with 'data-binding-disabled'.
Asked 29 Nov 2015 16:26:14
1
has this question
29 Nov 2015 16:26:14 Firdaus Rohman posted:
I need to use 'data-binding-disabled' with 'Conditional' 'does not Contain'.Usage is when I need an input to contain specific characters or words to enable the Submit button.
Perhaps there should be something like 'data-binding-enabled' or 'Conditional' 'does not Contain'?
Or did I miss something? I can achieve what I want with 'data-binding-show' but I just want to disable the button not to hide it.
Replies
Replied 30 Nov 2015 08:52:28
30 Nov 2015 08:52:28 Teodor Kuduschiev replied:
Hello Firdaus,
This requires a little bit of custom coding.
First, include this in your head tags, after the HTML5 Data Bindings Formatter include:
Then this is the code you need to bind to the button:
This requires a little bit of custom coding.
First, include this in your head tags, after the HTML5 Data Bindings Formatter include:
<script> function string(obj) { return obj + ''; } $.extend($.dmxDataBindings.filters, { notContains : function(val, str) { return string(val).indexOf(str) == -1; } }); </script>
Then this is the code you need to bind to the button:
data-binding-disabled="{{$FORM.yourFieldName.notContains( "enterWordHere" )}}"