Announcement Announcement Module
Collapse
No announcement yet.
disabled fields and spring:bind Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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.

    Comment


    • #3
      Originally posted by tatvamasi
      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.
      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.

      I haven't actually done this myself, just throwing out some idea, so let me know if it works or not.

      Comment

      Working...
      X