Apr 17th, 2006, 04:06 PM
disabled fields and spring:bind
I am able to bind bean variables to my html problem comes when they are being submitted. Some bean variables are initialized with 0 and they are disabled as they are binded. Now if user makes any change to fields that are enabled I calculate total and display in these disabled fields. Now when form is being submitted only enabled fields' values are being reflacted but no change for disabled fields. Any idea how to get around this? Any help will be highly appreciated.
Apr 18th, 2006, 04:45 AM
disabled fields are not submitted, and there are no work-arounds. But you can define onSubmit function in your form, and enable those disabled fields.
Apr 18th, 2006, 02:06 PM
Try this: bind the same bean variable to both a hidden field and a disabled display field, give the hidden field the name of the actual variable, and give a different name (you don't really care what it is I think) to the display field. That way (hopefully) the hidden field will always be submitted and bound to the bean variable.
Originally Posted by tatvamasi
I haven't actually done this myself, just throwing out some idea, so let me know if it works or not.