...

View Full Version : .net dropedown



ebco
11-20-2003, 08:17 AM
how to give onchange javascript validation for dropdownlist

basically what I want to do is if user selecting selectedIndex=0 then don't refresh & don't call the server site function else refresh

A1ien51
11-20-2003, 02:21 PM
If you are going to want it to autopost back, then you are stuck with it with the best of my knowledge

just make sure that you are checking for IsPostBack to help on the loading process of the page.

angiras
11-20-2003, 03:38 PM
for any javascript it's allways the same for each .Net control

anyControl.Attributes.Add("OnClick","JavaScriptFunctionName")

you will find everywhere a javascript for your case

A1ien51
11-20-2003, 04:21 PM
angiras

ebco does not want the page to autoRepostback with the option is zero. You can not stop that with JavaScript....

angiras
11-20-2003, 04:51 PM
but he says : don't refresh & don't call the server site

then it's a validation ClientSide without postBack
you can use your own Javacript or webControls validators

same thing for a delete button in a datagrid You can use a javascript before submitting the page : "are you shure you want to kill this customer ?"
if no there is no postback, if yes ... tool late



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum