View Full Version : Live radiobutton/flipswitch output

12-30-2011, 11:02 AM
I'm currently setting up a website to be used on android/iphone ect.

and i would like to have the changes made to the flip-switches, happen immediately,

it's is a website i'm making to control the lights in our house,
(don't worry, it'll be local network only)

and it would be nice if you could have a live output of either "0" or "1",

maybe something like

output :
room_1 0
room_2 1

but is there anyway to make it live, if not, how would i make the form output show a list like that?

i've posted an example of the page here


in the example i used

<form action="/output/output.txt" method="post" enctype="application/x-www-form-urlencoded" name="Lights Status">

i a attempt to get the form post to a txt file,

but no luck...

thx in adv.

12-30-2011, 02:36 PM
The action attribute has to go to a file on your server that generates the txt file. The web page can not do it.

12-30-2011, 03:16 PM
is there anyway you could do this in php?

i've got a mysql database?

12-30-2011, 05:45 PM
Yes, you can do it in PHP or another server side language. You might want to look into a more dynamic solution even with javascript (ajax) where you don;t need the submit button.