Using Validators To Ensure That User Filled Either One Of Two Required Fields?

Jan 31, 2010

I have an ASP.NET form for currency exchange requests. There are two text fields there: amount-source and amount-target.

One of them must be filled and only one.

How to implement this using Validators, if applicable?

View 2 Replies


Similar Messages:

How To Ensure Validators Fire Before Call Client Side Javascript

Feb 4, 2011

I have an asp.net application with basic CRUD functionality. On a page where i am capturing customer details i have several asp.net validators to required fields. I have attached a JS confirm box on the asp.net save button for the form. The trouble is that when the user leaves required fields unfilled and clicks the save button, the JS confirm box comes up, when the ok button is clicked, the save method is called successfully and only after this happened do the asp.net validators fire and display that required information has been left out.

View 2 Replies

Forms Data Controls :: Detailsview Clears Filled In Fields?

Aug 26, 2010

I have a details view on my page that has a template field in it. In the template field is a button that when clicked, sets the visible property of another field to true. When this happens the whole detailsview resets and anything that was entered into other fiields is cleared. Is there any way to prevent the other fields from being cleared when the hidden field is set to be shown.

View 1 Replies

Autocomplete: Display Data Different From What Is Filled And Filling In Multiple Fields?

Jan 5, 2010

I'm using asp.NET MVC, and am looking at the JQuery autocomplete plugin for what I want to do. I need some extra functionality that I don't think it provides.

I have a page with two text fields, First and Last name. Ideally, when someone begins typing into either, I would like autocomplete to display both the first and last name of all matches. If one of these matches were selected, I would like only the appropriate (first/last) name to go into the current field, while the other field is also filled in with the appropriate name.

So the problems here are that A) I would like the suggestion text to be different from the value that would be filled into the current field, and B) I would like to update multiple fields from a single autocomplete. Does this make sense? It seems to be difficult to find information on this situation on the net.

View 2 Replies

Web Forms :: Required Field Validators Not Working?

Jun 24, 2010

I have a contact page with fields like E-mail Address, Name, Subject, and Message. I use a RequiredFieldValidator on each text box. They work fine when I test it with the Visual Studio built-in development server, but on IIS7, they don't work and they allow the Send button's click event to be fired.

View 6 Replies

Web Forms :: How To Set Required Field Validators To Calendar

Dec 14, 2010

im currently doing a web application.

user are allow to insert some events.

but if user didnt insert any fields, error message should pop out.

but for my calendar view, if user didnt select any, it still can pass through but data is not stored.

so how do i set required field validators to calendar?

View 12 Replies

Web Forms :: From And To Date.Both Are Using Required Field Validators?

Feb 5, 2010

I have 2 date fields - From and To Date.Both are using required field validators, regular expression validtors and compare validators. When the user enters an invalid date range, e.g. 02-29-2010 to 02-29-2010 (non-leap year), the comparevalidator throws an 'from cannot be greater than to date range' error.Why am I seeing this error when From is not > To.Here's the code snippet

[Code]....

View 8 Replies

C# - Required Validator And Compare Validators Do Not Work?

Nov 17, 2010

I am trying to see the validation part working. I have few required field validators and compare field validators, etc.

<div>
<asp:RequiredFieldValidator ID="rfvCompany" ValidationGroup="groupProfile"
ControlToValidate="txtCompany" runat="server"
ErrorMessage="- Company Name Required" Display="Dynamic" />
</div>

[Code]....

View 2 Replies

Web Forms :: Required Validators And Literal Text?

Jan 24, 2011

I will do my best to explain what I am trying to do. This is a form that will allow the user to change his/her password with RequiredValidators in place.Here's how to reproduce the problem that I can't seem to figure out.1. Please open up the aspx file into a browser.2. Click the "Save" button. The required validators should kick in and prompt a "Required" message.3. Key in any word in the "Change Password" textbox except for the word "pass" since I have hardcoded it into the aspx file just for example sake over here.

4. Key in anything for both the "New Password" and "Confirm New Password" textbox.5. Click the "Save" button again. You should be able to see "Your current password is incorrect." next to the "Current Password" textbox which is a Literal control.Here's the problem: How do I hide or get rid of the Literal control when I click save again? Right after the form does a post back, all the password textboxes are empty and I can't find a way to bypass the required validator controls and then screen would look like this below.I will attach my changePass.aspx file code below for reference.

View 16 Replies

Web Forms :: Required Field Validators Not Firing In The Page?

Feb 17, 2011

I have required field validators in my ASP.NET application form.

In the button click event of the FORM, i.e. OnClientClick(), I am calling a javascript function to validate the controls in this same page. Due to this the required field validators are not getting fired.

I need both the javascript function be fired on the button click , as well as required field validators also to work efficiently.

View 9 Replies

Textboxes Alignment Messing Up When Required Validators Fire?

Sep 13, 2010

I have table with couple of textboxes in it. In those 2 fields I have required fields. When validators fire alignment is changing. Before the validators fire, textboxes aligntment is good.Pic1 for after validator fires. Pic2 for before validator fires. here is the HTML.

<table class="Borderblue" id="Table26" cellspacing="3" align="center" style="width: 100%;">
<tr>
<td bgcolor="White" style="width:20%" >

[code]...

View 1 Replies

Web Forms :: Required Field Validators Are Being Triggered By Other Buttons On Page?

Jul 15, 2010

I have created a form with several textboxes and a dropdown list and assigned a required field validator to each of them. I also have a master page with several links to other pages, some made using <a href=..> and some linkbuttons. The problem I am having is that when I click the linkbutton links they do not redirect to the proper page, rather they trigger the validators for all textbox fields and display the validator characters next to each textbox (and the dropdown). When I fill out the form, those links redirect properly. The links created using <a href=..> do not cause this problem.

View 5 Replies

Regular Expression And Required Field Validators Shutting Down Whole Website?

Jan 18, 2011

We are using regular expression and required field validators. They work fine, especially in out of the box environments like the log in control.

When used on other controls, e.g. a textbox, they also work, but we note that the whole site is in effect shut down until the expression is valid. I.e. the user cannot click cancel, or a link. The site only starts working again after the expression has been made valid.

How can this be fixed?

The validators should only apply to the control to validate and to the control that would cause the value of that control to be posted back to the server (e.g. a button), not the whole site.

View 2 Replies

Web Forms :: Validate Page Using Required Field Validators Before Print?

Mar 17, 2014

How can I validate the page using this javascript on Asp Button Control.

function PrintPanel() {
var panel = document.getElementById("<%=pnlContents.ClientID %>");
var printWindow = window.open('', '', 'height=700,width=1000');
printWindow.document.write('<html><head><title>Trainee Appraisal Form</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
setTimeout(function () {
printWindow.print();
}, 500);
return false;
}
<asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Print Only"
OnClientClick = "return PrintPanel();" />

View 1 Replies

Javascript - Validate 1 Of The 2 Fields With Validators?

Feb 12, 2010

I've got a simple form with some textboxes. These textboxes all have a RequiredFieldValidator. If field 1 is filled in I need to disable the RequiredFieldValidator of field 2 because only one of these fields is required. What is the best way to accomplish this?

View 2 Replies

Forms Data Controls :: Grid Is Being Filled To Check A Fields Value And Set Anothers Columns Value Depending On The Vale?

Jun 28, 2010

Im developing an ASP Web application and have a Gridview which I have set as follows:-

[Code]....

At this point alls good.

I have a field in the selected table that returns an integer which relates to a Table on a Seperate Database.

Is it possible, when the grid is being filled to check a fields value and set anothers columns value depending on the vale?

ie First Row Column 1 value is 1 so set Column 2 to "Sunny"

Second Row Column 1 value is 2 so set Column 2 to "Cloudy"

View 4 Replies

Web Forms :: Created Some Required Field Validators And A Validation Summary Control?

Feb 24, 2011

I created some required field validators and a validation summary control. When I get an error it displays next to the control its validating and also inside the validation summary control. I only want the error to display in one place; inside the validation summary control. I tried making the required field validator invisible but then it didn't display anywhere.How can I get the errors to only display in the validation summary control? There is no need to display them twice it just clutters up the page.

View 3 Replies

Web Forms :: Disabling Required Field Validators Using HTML Input Radio Button?

Feb 4, 2010

I have an html input control that is a radio button. This radio button needs to disable required field validators when selected. This is my non working code so far. What have I not done?

<input ID="card1" runat="server" type="radio"/>Card<br />
btnSubmit_Click
{
if (card1.Checked == true)
{
RequiredFieldValidator10.Enabled= false;
}
}

this however doesnt disable the control.

View 4 Replies

Web Forms :: How To Use Required Field Validators In The Insert Item Template In A Listview Control

Feb 22, 2011

How can I use required field validators in the insert item template in a listview control? The empty fields in the insert item template are preventing the user from deleting or updating ay other row.

View 6 Replies

Web Forms :: Enable Disable Required Field Validators Based On RadioButton Selection

Apr 17, 2012

I want to Enable Disable Required Field Validators based on RadioButton Selection using JavaScript

View 1 Replies

Web Forms :: Either This Group Of Fields Or That Field Is Required?

Mar 28, 2010

I'm trying to write a form for a user to leave a testimonial on the website. I would like a group of inputs related to the users name (title, firstname and surname) or an input for their company name to be required. They can leave both if they like, but they must at least either fill in all the inputs related to their name or the input for their company name.can I do this with the RequiredFieldValidator?

View 3 Replies

AJAX :: To Ensure User Enters All Of The Person's SSN?

Feb 4, 2011

I'm working with the AJAXControlToolkit in an ASP.NET 3.5 application. I've got a textbox on the page to take the person's social security number, and I've put an masked edit extender and an masked edit validator, force the user to enter the whole SSN, but it doesn't work. I'm not sure what I'm doing wrong, or have left out. Here's the relevant code:

[Code]....

View 1 Replies

How To Ensure User Accepts Terms And Conditions On Website

Jan 21, 2010

We're modifying an existing ASP.NET application. We added a Terms and Conditions page with an "Accept" button that stores that choice in the user's account data. We want to prevent the user from accessing any page when the user has not accepted the Terms and Conditions.

I think we want to do this by looking up the "accepted terms" value upon login and storing it in the session. Then we need to intercept every request and check for that session value. (If it's not there, we redirect the user to the Terms and Conditions page.)

Is the PreRequestHandlerExecute method the right place to put this check? This method also gets called on requests for stylesheets and images, so it doesn't seem like it was intended for this purpose.

View 5 Replies

MVC :: Model Not Validating Correctly In Controller. Optional Property With Required Children Fields

Oct 30, 2010

Basically I have RegisterModel2 that has a Person class. My requirement is that Phone Number and Address are not required for registration. But if they try to enter a Phone number of Address then it should validate it. Problem is that it is always stating that the child fields of Phone (area code, number) and child fields of Address (street1,city,etc) are required. Is there a way to annotate in the RegisterModel that a parent class is not Required but if any data in a child element is given then and only
then should the child elements be validated?

My Person EDM class has a nullable 0.1 -> 0.1 navigation property to Phone and Address.Here is the person class

[MetadataType(typeof(Person_Validation))]
public partial class Person
{
}

public class Person_Validation [code]....

The Person EntityObject has an optional/nullable Navigation Property to the Phone Object.


The Phone object has these annotations,[Code]....

I have RegisterModel defined as follows:
[Code]....

My View looks like this:
[Code]....

And here is my Controller Action it is posting to:
[Code]....

View 1 Replies

Security :: Access Level / Ensure That A User From A Particular Group Is Redirected To His/her Summary Page?

Apr 1, 2010

I have a summary page that has an Add New Record button, andEdit Record butto and a Delete Record button.Every user has ReadOnly access.However, only users with administrators Access Level can add, edit, delete, view.Users with Staffers Access Level can only Add records but cannot delete or edit.So, basically, 2 access Levels, Administrators, Staffers.Administrators can view, add, delete, update records.The rest, Staffers, can only view and Add records.I am struggling to figure this out.I have done this a ton of times using Classic ASP, something like:

If AccessLevel <> "Administrator" Then
Response.Redirect"login.asp" 'so if user has admin password, s/he ccan log in with that.
End if

[code]...

4 different groups will be using the system, each will be redirected to their own summary page based on their groupNumber.All I just want now is to ensure that a user from a particular group is redirected to his/her summary page, then that user is checked again against AccessLevel (view, edit, delete, update).

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved