corona coverting radio button to numeric textbox (lua)

Hi guys i am doing a mobile application about healthcare. I have to create a survey like application to screen the patients. Right now i have completed a part of the survey using radio button, the other part also look something like this(see picture below) but i want the radio button change to numeric textbox. 
my application look something like this(attached)

right now i want to convert the radio button to a numeric textbox.

the question is: how can i make minimum code changes and replace all the radio button to numeric textbox? 
Here are my code for the radio button

local radioGroup = display.newGroup() if(ebasRating\_Arr[i] == 0) then radioButton\_0 = widget.newSwitch { left = 565, style = "radio", initialSwitchState = true, id = tostring(i), width = 60, height = 60, onPress = setEBASRating0 } radioGroup:insert( radioButton\_0 ) radioButton\_1 = widget.newSwitch { style = "radio", id = tostring(i), initialSwitchState = false, width = 60, height = 60, onPress = setEBASRating1 } radioGroup:insert( radioButton\_1 ) elseif (ebasRating\_Arr[i] == 1) then radioButton\_0 = widget.newSwitch { left = 565, style = "radio", initialSwitchState = false, id = tostring(i), width = 60, height = 60, onPress = setEBASRating0 } radioGroup:insert( radioButton\_0 ) radioButton\_1 = widget.newSwitch { style = "radio", id = tostring(i), initialSwitchState = true, width = 60, height = 60, onPress = setEBASRating1 } radioGroup:insert( radioButton\_1 ) else radioButton\_0 = widget.newSwitch { left = 565, style = "radio", initialSwitchState = false, id = tostring(i), width = 60, height = 60, onPress = setEBASRating0 } radioGroup:insert( radioButton\_0 ) radioButton\_1 = widget.newSwitch { style = "radio", id = tostring(i), initialSwitchState = false, width = 60, height = 60, onPress = setEBASRating1 } radioGroup:insert( radioButton\_1 ) end radioButton\_0.y = 150 + (i \* 450) radioButton\_1.x = 18 + radioButton\_0.x+radioButton\_0.width radioButton\_1.y = 150 + (i \* 450) scrollView:insert( radioGroup ) end

i hope this is possible. Appreciate any help. Thanks

My suggestion is to look at the business app sample at:

https://github.com/coronalabs-samples/business-app-sample

And study the textfield code there. There is no automatic way to do it, you would delete your radio button code and add in the native.newTextField() 

Rob

Okay thanks will look at that

Hi rob,

do you have other textbox samples that I can take a look?

Thanks

There is a native objects sample app that ships with the Corona package.  Find the Corona folder and look in :

SampleCode/Interface/NativeDisplayObjects

It has a text box.

Rob

My suggestion is to look at the business app sample at:

https://github.com/coronalabs-samples/business-app-sample

And study the textfield code there. There is no automatic way to do it, you would delete your radio button code and add in the native.newTextField() 

Rob

Okay thanks will look at that

Hi rob,

do you have other textbox samples that I can take a look?

Thanks

There is a native objects sample app that ships with the Corona package.  Find the Corona folder and look in :

SampleCode/Interface/NativeDisplayObjects

It has a text box.

Rob