calvin Posted June 17, 2005 Posted June 17, 2005 I create a data entry page which contain a lot of textbox and using required field validator. So, when required field is not enter, error message will appear. My problem is the page also include a datagrid and bind with bound column and button column. The button column combine Edit & Delete button. When click on the button, the required field validator is activate. User cannot perform edit or delete command until all required fields are enter. How can i set the Causes Validation of Edit/Delete button to "False" since it can be done in form button. I didn't see properties of datagrid allow to set. Appreciate for those giving comments and help. Thanks Calvin Quote
mike55 Posted June 17, 2005 Posted June 17, 2005 I create a data entry page which contain a lot of textbox and using required field validator. So, when required field is not enter, error message will appear. My problem is the page also include a datagrid and bind with bound column and button column. The button column combine Edit & Delete button. When click on the button, the required field validator is activate. User cannot perform edit or delete command until all required fields are enter. How can i set the Causes Validation of Edit/Delete button to "False" since it can be done in form button. I didn't see properties of datagrid allow to set. Appreciate for those giving comments and help. Thanks Calvin Set the Enable client script for the validation control to false, then in your code create a validation method that is called when you are forwarding the data from processing. This validation method will firstly call the .Validate() for each validation control. You then need an if statement that check the result. 'In the code for the button click add the following if statement if validation = true then 'no errors do the rest of the processing else 'Data missing/incorrect. exit sub end if 'Your validation function private function validation() as boolean dim counter as int16 counter = 0 myControl1.validate myControl2.validate if myControl1.isvalid = false then counter = counter +1 endif if myControl2.isvalid = false then counter = counter + 1 end if if counter > 0 then validation = false 'there is a problem elseif counter=0 validation = true endif return validation end function Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
invitation Posted March 15, 2009 Posted March 15, 2009 When you submit a page, the validators on the page should be validated. There are two sides to submitting a page: client and server. Microsoft built in support to automatically validate both sides into these submit controls: Button, LinkButton, ImageButton, HtmlInputButton, HtmlButton, and HtmlInputImage. For menus and toolbars, you are on your own. DES provides support for the standard Microsoft buttons, menus and toolbars. While the system can be hooked up to any third party button, menu or toolbar, here are the controls that have been tested and documented in the User's Guide. Quote
apostille Posted April 6, 2009 Posted April 6, 2009 I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are linkbuttons which must not cause validation. I have found a setting "causeValidation" to disable the validation. Also on the page, I have a datagrid that I will edit lines on. I can click edit and cancel without enforced validation, however, if I click Update, the validation comes up. I have tried to put a causesValidation="false" in the linkbutton column on the datagrid but to no avail. When I hover over the Update link, I have... javascript:{if {typeod(Page_ClientValidate) != 'function' || Page_ClientValidate()) __doPostback... in the status bar. How can I override the Update link to prevent the validation from happening? Also, if I was to limit just the Update to the datagrid text boxes, how would I validate those? A third Q... when in edit mode of the datagrid, how can I use a DropDownList instead of a text box?. Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.