Web Forms :: Is It Possible To Validate At Least 1 Is Selected
Sep 18, 2010I have a form with several Drop Down List options, Is it possible to validate at least 1 is selected?
View 3 RepliesI have a form with several Drop Down List options, Is it possible to validate at least 1 is selected?
View 3 RepliesI have 2 radiobuttonlist in a web forms, each contains of 4 ListItem. So there are 8 ListItems in total. It is initialised such that none of the ListItems is selected. I want to validate that at least one of the ListItems is selected when submit button is pressed. How to do it? i.e. at least 1 ListItem is selected, either from radiobuttonlist1 or radiobuttonlist2.
View 9 RepliesI have 2 radiobuttonlist in a web forms, each contains of 4 ListItem. So there are 8 ListItems in total. It is initialised such that none of the ListItems is selected. I want to validate that at least one of the ListItems is selected when submit button is pressed. How to do it? i.e. at least 1 ListItem is selected, either from radiobuttonlist1 or radiobuttonlist2.
View 4 RepliesI have 1 drop down, 1 text field and 1 command button i.e. "Search". Dropdown contrains following values
Type1
Type2
Type3
In textbox user will enter numeric or alphanumeric value
Here I want to check if 'Type1' is selected so user can enter only numeric value between 1000 and 2000, otherwise display some message "Entered value is not valid for "Type1". I want to display this message thru required validator error message property
If user select 'Type1' and 'Type2' then user can enter any alphanumeric value other than 1000-2000 numeric range.
I want to implement thru Search button or once user leave the textbox after entering value. Here I want to display message.
In my website their is a textbox for adding birth date...
I am using the ajax calendar for selecting date...
I want that the user who enters the date shld be above 16yrs old...
Means i want that the date should be minus from the current date and should be calculated as 16yrs or above it...
For example:- user 'A' selects a date 5th may 2005 and the current date is 28th march 2013 (which means that the age is 8 yrs)... than it should show an error that "your age should be above 16 yrs"...
Front-end:- Asp.net C#
Back-end:- sql server 2005
Note:- I am using Ajax Calendar....
i have a drop down list and a text box, inside a listview row (and this is a repeating layout). i populate each dropdownlist with same contents ( these contents/items come from a custom collection object).
i have added a required field validator in the listview's item template, that has its validation group = the validation group of the drop down list, and validates if the textbox is blank or not. this validation takes place on the selected index changed of the drop downlist for that row.
1. on selected index changed, EACH dropdownlist validates only its corressponding textbox perfectly (which is what i want)
but if i enter some text in one of the textboxes after doing 1, the dropdownlist for THAT particular row, assigns the correct value to the text entered. but for other rows (for which i changed their corresponding ddls to test the required field validation and for which the text boxes are still blank), their ddls by itself assign the values to the blank text without validating.
markup of code for listview is [Code]....
code behind for the ddl selected index changed is [Code]....
method GetIndexFromId retrieves index of the custom object inside a collection depending on the Id (which is a property) of the object.
i notice that the ddl selectedindexchanged is being hit as many number of times as many rows i change (i.e as many ddls in different rows i change to check the required field validation)
I have form with a HTML.DropDownList and a HTML.SubmitButton. I would like to validate item selected in dropdownlist once there is a click in submitbutton. Any ideas?
View 2 Repliesi have a textbox for date of birth with calender as an extender i want when the user click the date it should only accept the date when the age between 15 to 40
View 1 RepliesValidate a checkbox list using server side validation, to make sure atleast one value is selected?
asp:CheckBoxList ID="CheckBoxList1" runat="server" RepeatColumns="3">
<asp:ListItem>1st</asp:ListItem>
<asp:ListItem>2nd</asp:ListItem>
<asp:ListItem>3rd</asp:ListItem>
</asp:CheckBoxList>
<asp:Button ID="Button1" runat="server" Text="Submit" />
I have an asp.net control textbox, clicking on which a jquery timepicker appears and user can select any time.But I want to validate the selected time so that it is one hour greater than the current time in the client side. I mean when textbox value will be changed it should be validated.
View 1 RepliesCan i get the selected index,selected value , selected text using javascript of ajax combobox control. if yes send me the sample code.
View 7 RepliesI'm trying out the jQuery Validation plugin jQuery Docs Here is the markup of my form:
<% using (Html.BeginForm("action", "contoller", null, FormMethod.Post, new { id = "sxform" })){%>
<div id="manifest">
Manifest Option:<br />
<%= Html.DropDownList("docid", ViewData["manifests"] as SelectList, new { @class = "required" })%>
</div>
<div id="release">
Release Version:<br />
<%= Html.TextBox("release", null, new { @class = "required" })%>
</div>
<div id="locale">
Localization:<br />
<%= Html.DropDownList("localization", ViewData["localizations"] as SelectList, new { @class = "required" })%>
</div>
<div id="label">
Label:<br />
<%= Html.TextBox("label", null, new { @class = "required" })%>
</div>
<div id="session">
Session ID (optional):<br />
<%= Html.TextBox("sessionInput", null, new { @class = "required" })%>
</div>
<div id="submit"><input type="submit" value="Build" /></div>
<% } %>
JS:
$(document).ready(function(){
$("#sxform").validate();
});
I am using MS MVC HTML Helpers to render this form. The resulting markup looks fine. IE each input and selection element contains the attribute 'class' with the value 'required'. When I submit this form the validation does noting.
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 RepliesI have two gridviews on same page - If a record is selected in Gridview1, I need to unselect a record (if one is selected) in Gridview2 - and vice-versa.
View 5 RepliesTwo ListBox Items Compare and Distinct Values Insert Into Third ListBox
View 1 RepliesHow to get the selected item from the listbox in the selected index changed event. I tried: Label1.Text = ListBox1.SelectedItem.Text; It is giving me object set to null reference.
foreach (ListItem item in ListBox1.Items)
{
if (item.Selected)
{
//lblResults.Text += item.Text + "
";
Label1.Text = item.Text;
}
}
No use, no value coming in to label.
I'm having trouble getting selected items in a listbox to be seen as selected. On my aspx page there's a listbox and a button:
[Code]....
But if I change my condition to Not selected, the string does build, with every item in the list. So the Sub is reached, the items and their text and values are seen, but user selection of items doesn't work. What am I missing?
I'm new to asp.net and I have quite an annoying issue. I have a masterpage and a number of linkbuttons to navigate through the aspx pages.
My problem is that when I click on a linkbutton than the one selected, it doesn't highlight the selected linkbutton, because postback has been initialized. Instead it highlights the linkbutton that I have specified in the Page_Load event.
I've tried to specify:
[code]....
Values in multiselect dropdown not getting selected when Select All option is selected for a SSRS dropdown. There are multiple dropdowns on the page. We have one dropdown whose output is being used to populate the second dropdown using a stored procedure. When we check the Select All checkbox on the dropdown then ideally upon page refresh all the values should get selected in the dropdown, but in this case the page refreshes back to the blank dropdown, forcing the user to select the values again. The next dropdown too does not get populated. This makes it impossible to run the report for all the cases by using Select All. We ran the report on differnet database environments. My current location is Mumbai,India, the report worked fine when we ran it on a Bangalore,india database. This issue occurs when we try running it on a Chicago database server. I am using SSRS 2005, SQL2005.
View 1 Replieshow to display GridView Selected Row in dropdownlist and radiobutton outside GridView in ASP.Net?
View 1 Repliesif the checkbox is true then it move to another page or else it back to same page and produce a error msq..it all done by click a command button
View 2 RepliesI've 2 textBoxes
txtQuantity
txtDesc
if txtQuantity is a positive Number
I must enter something in txtDesc
So
I can't submit the form without entering txtDesc if txtQuantity is positive/decimal number & No need to enter anything in txtDesc if the txtQuantity is 0/null/empty/space/spaces/blank How?
I have a problem, that is in my asp.net page I am having a master page there are many derived pages are there. in the master page I kept login control and validation and signin done in the master page itself, also I am having a create user page, if I execute create user page, unable to login from this page. because create user text box validating as well in the same page if I click create user button its validating login. how to avoid this? a button & text box & validation should be respective area only.
View 4 RepliesI want to validate the text Box
1. It's not allowing only nubers
2.It's should be combination of numbers and alpahbets
3.It's should not allow only dateformat
I have a simple question. I getting the below URL from my WebService. However, I need to add the mycompany.com to the Domain, if it's missing in the URL. Can someone please provide the code snippet. should I use the system.url?Example:http://groamrtst183/webservices/temp/v0032315/page001.tif Should be look like:http://groamrtst183.mycompany.com/webservices/temp/v0032315/page001.tif
View 2 Replies