Hi Abu,
I've a question for add records.
It's possible change default and type by value of field in add form ?
Exemple if value of field TYPE_INSERT is 1 the user can insert a text.
Instead in valude of field TYPE_INSERT is 2 the possibility is true / false by checkbox.
Thanks in advance.
Nicola
Hello,
I understand your questions as, you want to change input type of some other field 'X' based on input value of field TYPE_INSERT.
It will need some custom JS code + testing.
If your TYPE_INSERT field is dropdown,
then you can connect onchange event with it and using Jquery code, replace textbox with checkbox html.
e.g.
1) On TYPE_INSERT field, you can set $col["edit_options"]["onchange"] = "function(o){ change_field(o); }";
2) In JS,
<script>
function change_field(o)
{
if (o.value == 1)
$("#X").replaceWith("<input type='checkbox' id='X' name='X' value='true' offval='false' class='FormElement ui-widget-content ui-corner-all' role='checkbox'>");
else
$("#X").replaceWith("<input type='textbox' id='X' name='X' class='FormElement ui-widget-content ui-corner-all' role='textbox'>");
}
</script>
Thanks Abu for fast answer and perfect solution.
Where can find the the different parameters (example FormElement ui-widget-content ui-corner-all) for improve my application ?
Best regards.
Nicola
Hello Nicola,
I checked it via firebug (f12) by inspecting DOM elements.
You can do same.