C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » JavaScript »

Javascript how to make the dropdown value to reset to intiall value(checking the check box


Posted Date: 30 Oct 2009      Posted By: kumar      Member Level: Gold     Points: 1   Responses: 3



hi, "INSERT MODE"

i have check box in one "tr". and another dropdown control in another "tr" intially dropdown control will be invisiable intially .

but once the user checks the check box. the dropdown control should be visiable and he can select the value. but again the user unchecks the check box the dropdown should be set to default value that is "--selec--"

"UPDATE MODE" intailly checkbox.Test = dt.cloumn["state"].tostring();

if(checkbox.Test!= "") { checkbox.checked=true; //then value dropdown value should be shown like"india" } else { checkbox.checked="false" //then value dropdown value should be default "--select" } in insert mode checkbox willbe unchecked in update mode if checkbox in checked then the value of dropdown should be shown"india" in update mode if checkbox in unchecked then the value of dropdown should be shown default"-select-"





Responses

Author: Programmer    30 Oct 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

On the onchange event of the checkbox write a javascript function.In this function access the dropdown control and set the value as per your requirement.


Author: kumar    30 Oct 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

thanks for the replay but i am new to javscript programming can u give te sample code how to do it
thank you



Author: lakshya    30 Oct 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

you may try this:
set the autopostback property of checkbox to true , this will post back the page. checkbox has an event CheckedChanged , qrite your code their

Happy dotneting Spread Smiles :-)
Visit Lakshya



Post Reply
You must Sign In to post a response.
Next : Any alternate to isDate()
Previous : How to find date within a given range using javascript
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use