Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

is there a way to use multiple stage buttons to insert values for database ?

Buttons have one stage like submit, checkbox have two (on off), i want a button that changes red,orange,green in each click. After preparing like 30 buttons on the right color i need to submit these to database...

Should i use image buttons and javascript or is there an easy way of doing this. i use asp.net and mysql.

i could do this very easily with flash if it was a php project but i dont know what to use in asp.net... And i dont want to use flash for being mobile friendly
Posted
Comments
ZurdoDev 21-Jan-16 8:55am    
There is no built-in way to do it that I know of; other than using CSS and keeping track of the next state.
Sinisa Hajnal 21-Jan-16 9:35am    
Add custom data-color or data-status attribute in the button and track it that way.
<button id="btnFirst" runat="server" data-color="Red" ></button>

If there are only three stages, you could use three-state checkbox/checkbutton
burakdogmus 22-Jan-16 9:00am    
Indeterminate Checkboxes i guess...three state checkbox seem to be only visual. when i scan the value it gives 1 or 0 only. indeterminate state render different in browser but value doesn't change.

custom attribute thing is a good idea. ill work on that...
Sergey Alexandrovich Kryukov 21-Jan-16 10:05am    
Not clear. What stages? "Submit these..." what "these"? buttons? :-)
—SA
burakdogmus 22-Jan-16 8:35am    
those stages will be used in attendance. absent, present, excused absence, left with permision, left without permission. 5stage would be confusing so 3 stage would be enough.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900