Web Forms :: Validate At Least One Of Two TextBoxes Must Have Value Using Custom Validator
May 7, 2015I have two text boxes one is mobile no and another one is landline number . how to make any one of them as required..
View 1 RepliesI have two text boxes one is mobile no and another one is landline number . how to make any one of them as required..
View 1 RepliesI am running the code below in a .net 2.0 content page.There are no containers such as wizard etc. When I click on the submission button for debugging purposes I get 'Nothing'. why I can't access the 'controlToValidate'?
Protected Sub validateCharacter(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)
If Page.IsPostBack Then
Dim validationControl As CustomValidator = DirectCast(source, CustomValidator)[code]....
How to validate if gridview is empty rows or not, i want to use ValidatorCalloutExtender.
View 1 RepliesIs it necessary to give Control to Validate control in Custom Validator?
If yes then why this will happen?
I created my custom validator in one project, something like that:
[Code]....
he composite control in another project. I added a reference of the custom validator project to the composite control project. I have a textbox in a composite control and I would like to validate this textbox by the composite control I created. But how can I do that? How can I create the custom validator instance that is linked to the custom validator I created?
I want to compare 2 textboes with date in such a way that one must be less than other. Compare validator is not working Here is the code
[Code]....
I have a two textboxes on the same page with their corresponding buttons to enter the data and both the textboxes require validation.
The problem is that if any of the two buttons is clicked it causes client side validation. What I want is only corresponding button shud cause validation.
i want use this control for dropdownlist i wrote below code
<asp:DropDownList ID="DDL2" runat="server" CssClass="DPCDDL">
</asp:DropDownList>
<asp:RequiredFieldValidator Display = "Dynamic" ID="RequiredFieldValidator4" runat="server"
ErrorMessage="please select your classification." ControlToValidate="DDL1" CssClass="valid1"></asp:RequiredFieldValidator>
but it didn't work how i can define that users should select one item from DDL?
I need to validate two textboxes for date range in client side. what is the best approach ?
View 3 RepliesI have a validator callout extender that works, it shows the callout box. But, it does a postback. It didn't do a post back the first time I clicked the button but it did for subsequent times. I read on the AJAX site that a custom validator must be used with this for it to work. I'm currently using this with a required field and regular expression validator. It works, the callout appears, but it doesn't work every time with out the post back.I posted this to see if there is a way to get this to work with a required field and regular expression validator, with out using a custom validator. I'm using the newest release of the toolkit, so I thought the documentation may be old, since the callout is appearing.
View 8 RepliesI have a form that contains several textboxes and each one paired with a required validator. Each box reads a value from a dataset, and on submit click, update the database with the new value. For some reason, one of the validator always returns the error message even if I enter a value in the textbox. My code is something like this.
[Code]....
In my website I need to validate email address format. I need to use ASP.Net RegularExpression Validator
View 1 RepliesCan any one let me know "How to validate the length of the text present in the textboxes of a Gridview using javascript".
For Example: In a page I am displaying a Gridview with textboxes inside it and a button on the page. The user need to input some text in the textboxes of the gridview and click on "Submit" button. When the user clicks on Submit Button, we need to validate the length of the text present in the textboxes of the gridview. If the length of the text inside the textbox of the gridview is less than 10 , we need to throw an error message. In the same way we need to do validation for each and every textbox inside the gridview.
How to use single requiredfield validator for two or three textboxes in asp.net ?
View 1 RepliesI'm actually wondering if there's a way to use the MaskedEditExternder and Validator to be linked with several textboxes. I have over 30 textboxes where user inputs a date and I need to validate the format. Instead of linking the extender to each and every textbox control, is there a way to make it easier for validation on every textbox but using only one Extender and Validator control?
View 2 RepliesIve attached an example below. I want all the textboxes to clear when I click the Clear button however they will only clear if all the textboxes have text in them(validated). Is there anyway of certain buttons ignoring validations? I used a RequiredFieldValidator.
View 3 RepliesIs it possible to validate an entry using a validator if the inputted account number exists on the database?
View 4 RepliesI've been trying to get a custom validator component working that ensures at least one checkbox from a checkboxlist has been checked. I've been used some code I found on dotnetjunkies.com but the client-side validation didn't work. I've been attempting to modify it to get the client-side javascript validation to work with no luck. Basically, I compile the below code into a DLL and add it to my bin folder.
[Code]....
How to validate two textboxes at single button click using vb.net ?
it shows an error :
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1 = "06:00:01 PM" & TextBox2.Text = "02:00:01 PM" Then
MsgBox "Submit"
End If
End Sub
Whatz wrong with my this code ? I wanna validate two checkbox using if statement ... on Button click
I got couple textbox , txt_day,txt_month,txt_year,txt_hh,txt_min.How to validate a valid date.
View 3 RepliesI've set up a page that uses JavaScript to hide or show rows in an HTML table, depending on the state of a checkbox.
So far, so good. But this is a data entry form and some rows include validation controls. However, it appears that if I hide a row (using JavaScript: style.display = 'none') that contains a validation control, the control still validates on an attempt to postback.
way I can do this but have the validation controls not do anything if that row is hidden?
i am working on asp.net, for example in a form they are 10 text boxes i want to validate each textbox if it is empty it should display a alert message.
how to achieve this by using a single javasript method. can we pass texbox as an argument into javascript how to achieve this
I'm looking to validate the length of a textarea using a regular expression validator. It should allow all characters and crlfs. I'm also concerned about crlfs counting as 1 or 2 characters, I'm concerned it may be different across browsers but I'm hoping ASP.NET regulates it. Also, I'm saving to a mix of varchar and nvarchar fields in MSSQL, do I need to be concerned about the way crlfs are saved there? I'm in a hurry to do this right, so I'll be researching all this on my own but I'm just hoping someone out there might have experience handling such concerns.
View 1 RepliesI would like to validate the textbox for specific text and it must not be blank. But the regular expression validator is not validating if the text box is BLANK. However, it validates if I type something in the text box.
How can I make regular expression to trigger even if the text box is empty?
Should I use Required Validator + Regex Validator at the same time?
<asp:TextBox ID="txtcard" runat="server" MaxLength="16"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
ControlToValidate="txtcard" ErrorMessage="Please type credit card no"
ValidationExpression="^d{16}$"></asp:RegularExpressionValidator>
I would like to know how to use jQuery's Validate plugin to add rules to validate controls in ASCX custom user control?
View 4 Replies