First, sorry for my english.Ok.. the code is a mess because I try many different ways.if you want to try the code localhost, you can easily replace my database query by php variables + ive put the major string and text in english for an easier understandingWhat im trying to do looks like simple.. but for me javascript isnt making me life simple! I want to have a simple button, which change (toggle) a sql value onclick and then the value of the button change for the new sql value.. if no sql errors.Exemple of what I expect:
- I retrieve a value form a specific row in the database: RAIN = 'yes'
- Now when the page load, if the RAIN value = http://stackoverflow.com/questions/15856778/yes, the button value will be set to RAIN, else value will be NO RAIN.
- We suppose the row value RAIN is set to 'yes' -> when I click on the button, the row value will be set to 'no' and then if no sql errors, button value will change for NO RAIN. and etc..