Checkbox checked sends text to a myData.Variable

Hi guys this is what I am trying to do, I have three checkboxes and three display.newText what I am trying to do is when checkbox1 is checked myData.var1 is set to display.newText my issue is I can’t work out how the code looks bearing in mind I need the checkboxes to disable themselves if one of the three is checked unless then unchecked. Anyone know where to start here?

Thanks again,

Matt.

Sounds like you want radio buttons rather than check boxes. You could try looking at the example at 

http://docs.coronalabs.com/api/library/widget/newSwitch.html.

Specifically:

local widget = require( "widget" ) -- Handle press events for the buttons local function onSwitchPress( event ) local switch = event.target print( "Switch with ID '"..switch.id.."' is on: "..tostring(switch.isOn) ) end -- Create a group for the radio button set local radioGroup = display.newGroup() -- Create two associated radio buttons (inserted into the same display group) local radioButton1 = widget.newSwitch { left = 150, top = 200, style = "radio", id = "RadioButton1", initialSwitchState = true, onPress = onSwitchPress } radioGroup:insert( radioButton1 ) local radioButton2 = widget.newSwitch { left = 250, top = 200, style = "radio", id = "RadioButton2", onPress = onSwitchPress } radioGroup:insert( radioButton2 )

Sounds like you want radio buttons rather than check boxes. You could try looking at the example at 

http://docs.coronalabs.com/api/library/widget/newSwitch.html.

Specifically:

local widget = require( "widget" ) -- Handle press events for the buttons local function onSwitchPress( event ) local switch = event.target print( "Switch with ID '"..switch.id.."' is on: "..tostring(switch.isOn) ) end -- Create a group for the radio button set local radioGroup = display.newGroup() -- Create two associated radio buttons (inserted into the same display group) local radioButton1 = widget.newSwitch { left = 150, top = 200, style = "radio", id = "RadioButton1", initialSwitchState = true, onPress = onSwitchPress } radioGroup:insert( radioButton1 ) local radioButton2 = widget.newSwitch { left = 250, top = 200, style = "radio", id = "RadioButton2", onPress = onSwitchPress } radioGroup:insert( radioButton2 )