aspose file tools
The moose likes JSF and the fly likes Enable Command Button on entering all values in mandatory fields Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Enable Command Button on entering all values in mandatory fields" Watch "Enable Command Button on entering all values in mandatory fields" New topic
Author

Enable Command Button on entering all values in mandatory fields

trupti gore
Greenhorn

Joined: Aug 31, 2006
Posts: 3
.Next Button should be enabled only when all required fields have been selected or filled.

Can any one help me out with this,
I have written javascript on onchange of textfields, but now i have too many mandatory fields, how it can be done using "Rendered" attribute and also disabled="true" is creating problem as not passing the value to next page.

Thanks in adv
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14460
    
    7

Unfortunately, you need javascript.

The rendered attribute is applied when the page reloads and is redrawn by the server, so you'd actually have to make a server request (which is what the commmand button does anyway).

When set by the server, I've had problems with the disabled attribute. On one program, I could re-enable the control with client-side javascript, but since the page had been rendered with a disabled control, it didn't have the extra support that a fully-enabled control would have, even though I had enabled the HTML control itself.


Customer surveys are for companies who didn't pay proper attention to begin with.
trupti gore
Greenhorn

Joined: Aug 31, 2006
Posts: 3
Thanks Tim

The Same has been done using Javascript
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Enable Command Button on entering all values in mandatory fields
 
Similar Threads
trapped in html:cancel tag ...
carrying info across pages...Pls help.
intermediate submit and validation of a form
Wanted to hide and show the fields at runtime
multiple forms in struts