•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 429,888 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,326 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 797 | Replies: 4
![]() |
hi
i am developing a site in asp.net 1.0 for validation i have created a js function
where i am checking all controls for null
my text boxes are validated with that function but not combos.
here is the code i used to validate combos
This is not worked then i tryed this
but nothing is done. also no error.
plz help.
i am developing a site in asp.net 1.0 for validation i have created a js function
where i am checking all controls for null
my text boxes are validated with that function but not combos.
here is the code i used to validate combos
if(document.Form1.cboCity.selectedindex == 0)
{
document.Form1.cboCity.focus();
alert("Please Select Your Current Location.");
return false;
}This is not worked then i tryed this
if(document.Form1.cboCity.value == 0)
{
document.Form1.cboCity.focus();
alert("Please Select Your Current Location.");
return false;
}but nothing is done. also no error.
plz help.
Last edited by peter_budo : Apr 19th, 2008 at 8:41 am. Reason: Keep It Organized - please use [code] tags
Accept Challenges and Enjoy Coding... :)
You seem to be in serious need of some good Javascript tutorials.
First of all, Javascript is case sensitive, hence
First of all, Javascript is case sensitive, hence
selectedindex is not the same as selectedIndex. Also, the values of form controls are always of type string, so checking a textbox value for 0 seems pointless enough. It should be txtInput.value.length == 0. Last edited by ~s.o.s~ : Apr 16th, 2008 at 1:43 pm.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Previous Thread: Drop shadow around content?
- Next Thread: viewing html source from javascript



Linear Mode