On the edit page there is a date field, When it is not empty, an other field’s, (a checkbox with 4 option) first option is disabled. I can control it in the Client scripts/edit page/startup script section. The user must select at least one option, when date field is not empty, except the first option. I check whether the user select an option and if not, in the Common/Row_Updating I set a failure message and return false, to prevent updating… After it, the disabled (first) option becomes enabled, despite of, it is disabled in the Startup Script, I tried it in the Client Script too, but nothing changed. After return FALSE to prevent the update what happens? If the edit page loads again, why ignores the disabled property in the script?
boribon2 wrote:
it is disabled in the Startup Script, I tried it in the Client Script too, but nothing changed.
Please post your code for more discussion.
This is my code. It works perfect when the edit page loads first. But when no option selected, and Row_Updating return FALSE, and the edit page loads again, the first checkbox becomes enabled, but the condition isn’t true, the code in the ELSE should execute, but it doesn’t. If I copy this code into my browser js console, it works.
if($(“input[name=‘x_tartostavollet’]”).value()==“”)
{$(“input[name=‘x_postafiok_rendelkezes’][value=‘1’]”).prop({disabled: false});}
else
{$(“input[name=‘x_postafiok_rendelkezes’][value=‘1’]”).prop({disabled: true});}I tried insert only this code without condition into client script, and startup script (of edit page): $(“input[name=‘x_postafiok_rendelkezes’][value=‘1’]”).prop({disabled: true});}
but it doesn’t work.
If the field “postafiok_rendelkezes” is a lookup field with lookup table or user values, you need to use the “updatedone” event, you may search “updatedone” in this forum for examples.
Thank you, it works fine.