Hi guys,
I’m trying to make my scene go to the next using the composer providing all my textboxes have input inside and one of my two switches is on. If not I wanted it to show an alert to saying which one needs input. But its not working the way I wanted and I can’t work out how it should look. Could someone please help me out here?
[lua]
local function OnbtnNext( event )
if event.phase == “ended” then
myData.dateDay = textBoxDay.text
myData.dateMonth = textBoxMonth.text
myData.dateYear = textBoxYear.text
myData.timeHour = textBoxHour.text
myData.timeMinute = textBoxMinute.text
end
if radioButton1.isOn == true then
myData.IRb1 = textWasThisA.text
end
if radioButton2.isOn == true then
myData.IRb1 = textWasThis.text
end
if textBoxDay.text == “” or textBoxDay.text == nil or
textBoxMonth.text == “” or textBoxMonth.text == nil or
textBoxYear.text == “” or textBoxYear.text == nil or
textBoxHour.text == “” or textBoxHour.text == nil or
textBoxMinute.text == “” or textBoxMinute.text == nil then
local alert = native.showAlert( “Warning”, “ERROR: No input in textbox(s)”, { “OK” }, onComplete)
end
if radioButton1.isOn == true or radioButton2.isOn == true and textBoxDay.text ~= “” or textBoxMonth.text ~= “” or textBoxYear.text ~= “” or textBoxHour.text ~= “” or textBoxMinute.text ~= “” then
composer.gotoScene( “incidentReportingPg3”, { effect=“slideLeft”, time=800,} )
elseif radioButton1.isOn == false and radioButton2.isOn == false then
local alert = native.showAlert( “Warning”, “ERROR: No input in checkbox(s)”, { “OK” }, onComplete)
end
return true
end
[/lua]
Thanks again,
Matt.