read only eform

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

read only eform

kotharv
Hello,

I attached the sample code,

i designed a way, if i click on a check box it should make the from read only( i mean all the sections).

in my form i am passing the value to other instance variable and using it to assign the value to section control setting.

my 2 requirements,

1.is there any better alternatives?

2.i need the name control to be marked as required before i make it read only?

could you help me to achievetest_form.xml the above.
Reply | Threaded
Open this post in threaded view
|

Re: read only eform

Erik Bruchez
Administrator
> 1.is there any better alternatives?

The approach seems fine, although it requires you to make changes to the source of the form which is always dangerous.

If you don't mind having the `lockform` value stored alongside the data, then you can skip adding your own instance and just use the Form Builder UI to make the section readonly.

> 2.i need the name control to be marked as required before i make it read only?

Can't you just do that, make it required?

-Erik
Reply | Threaded
Open this post in threaded view
|

Re: read only eform

kotharv
hello Erik,

thanks for the reply,

i may not have explained enough,

my requirement not just to make a control mandatory, when check the checkbox, it should check the name value and if its null, its shud make that control as mandatory and do not make it readonly.

my final intension is the letz take name control as a discharge date where the date can't be predicted.  On discharge date or locking the form  its should be null.
Reply | Threaded
Open this post in threaded view
|

Re: read only eform

kotharv
typo,

On the day of discharge or locking the form  discharge date should not be null.
Reply | Threaded
Open this post in threaded view
|

Re: read only eform

kotharv
could you kindly update based on my recent description of the requirement.
Reply | Threaded
Open this post in threaded view
|

Re: read only eform

Alessandro  Vernet
Administrator
Hi,

So you're saying that if the name field is empty and the "readonly" checkbox is checked, then the name field shouldn't be made readonly? What should happen to the other fields in the section in that case? Should they also not become readonly? If it is just the name field that should not be readonly in that case, you'll need to move that expression from the section the fields, and have the same expression for all the fields, except the name field.

Alex
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet