partial Validation for multiple submit button in jsf 1.2 - jsf-1.2

i have one form with dozens of components. currently i am not able to use ajax as its showing some error. i want to validation field only for one submit button but as i have more than one submit button it gives error for others as well. whhen i use immediate for other button action of that button not able to access submitted values.
question is there any way to placed validation for particular submit button when having more than one submit button in a form?
Pls can any one help me in this ?

Use required=”#{!empty param[‘frmName:btnSave’]}” this for the fields with btnSave as id of button on which validation is required.

Related

Spring MVC : Multiple buttons with different actions

Can we have multiple submit button with different actions??
I mean if we have button "Save" and button "Next" each one have it own action to do !
Save have to save the current Model ..
Next have to load the next ModelAttribute on the next page..
A <form> submit button will invoke the action url of that form by default.
You may better want to have two buttons wrapped inside you html content and handle the click event on each one separately either with oncick event or with JS (jQuery should be you best friend).

ASP.NET validation controls

I have a situation where I have a form that has some validation controls for required fields. They fire just fine if the user does not have the required fields.
The thing is I also have a menu above the form which allows the user to select another location which is then reflected on the form.
This is where I run into an issue...
If the user already selected a location and then wishes to change to a different location, the form does not allow for this as required fields have not been entered.
I was wondering if there is a way to tell the validation controls not to fire in these situation.
My other option would be to do a validation on click of the submit button in which case I would not be able to take advantage of the ASP.NET required validation control.
Basically I want the validation to occur for the required fields only if the submit button is clicked.
Look at CausesValidation and ValidationGroup properties. I think they will help you to solve your problem
On the menu item set CausesValidation to false.
You can also use validation groups and set the validationgroup property of the validator and the submit button to the same value.

ASP.NET - RequiredFieldValidator to validate only particular controls

I have a web form. There are many different sections. I can say that each section displays data of a datatable. At each section I have OK and Cancel buttons. When I press OK any changes to the table in the database takes place. I've also put some Requiredfieldvalidators. Let's say I'm inserting a new record in the section one and the fields are correctly typed. When I press OK I get error message raised by the rest of the validators that are on the other sections. Isn't there any way that when I press OK button of a particular section to get validation errors of that same area? So what I probably need is a button that will not serve as the hole page submitter but rather a submitter of a specific section.
Place a ValidationGroup on the RequiredFieldValidator's. Then place the same ValidationGroup on the correct submit button. When its clicked, only validation controls that are a part of the group are validated.
http://msdn.microsoft.com/en-us/library/ms227424.aspx
I think janhartmann is correct ValidationGroup can help you solve the issue.Have a look at this article

ASP.NET validation

I have a little problem with the validation in one form
the form is composed by two taqs. There is a "Save" button in each tap (is the same control for both) and saves the form info. there are validation controls in one tab but not in the second. When we try to save the info from the second tab, and the info has not been filled in the first tab, the validators fire, and nothing happends, but because this validators are shown in the other tab, the end user might be thinking that the operation has been completed, instead, I would like to show a msgBox telling the user about the errors in the other tab. How do I know that the validators in the other tab have been fired, and display the error message when the button is clicked?
You should use the ValidationGroup of your validator controls and the appropriate submit button. You can also use a ValidationSummary control which displays a summary of the validation messages - this can be set to display a message box if you want by setting the property ShowMessageBox=true.
taqs - tap
dear why are you so confused?
All the validators are posted to the page as JavaScript functions. You can call the validation function on button's click and take the appropriate action.
You can use on buttons
onClientClick="Page_ClientValidate();"

ASP.NET: Only perform validation when Submit is clicked

I have an ASP.NET entry form where several controls have validation set up. The form also includes a display of previous records, each with a LinkButton control that acts as a delete button. Problem is when a LinkButton is clicked, it performs validation on the entry portion of the form, fails, and the delete is not processed. I didn't write this form and I'm not up on the validation controls, and I'm just adding the delete buttons, so how would I work around this?
Set CausesValidation to false for the control in question?
Are you saying that there are buttons on the form that when clicked are causing validation to take place...and that these buttons should not peform the validation?
If so, then you probably need to group all the controls and buttons that are part of the validation. To do this you set the 'ValidationGroup' property for each control involved in the validation (this includes the buttons that fire off the validation).
This should stop buttons that are not part of the validation, firing the validation process.
Check this link out:
http://www.w3schools.com/ASPNET/prop_webcontrol_imagebutton_validationgroup.asp
and
http://www.dotnet-guide.com/validationgroups.html

Resources