Editor Forms question 2: Staged entry for Country and then State selects

Editor Forms question 2: Staged entry for Country and then State selects

jfeyjfey Posts: 10Questions: 0Answers: 0
edited August 2012 in Editor
I like to let the user select a country first. Easy to do with a select type and the AJAX call to the server to get the JSON data for the countries. Then its getting interesting because if the Country is "US" (or whatever) i like to show a second select field for the States.

So the simple solution would not work:

{
"label":"Country",
"name":"country",
"type":"select",
"ipOpts": countryLoader()
},
{
"label":"State",
"name":"state",
"type":"select",
"ipOpts": stateLoader()
}


How could i do this?

cheers

Juergen

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    You would need to attach an event handler to the select menu to use the show / hide API methods of Editor to show and hide the required fields. The select menus has an ID which reflect their given name, so you could bind a 'live' / delegate event to it so it will always be present and take the required action.

    Regards,
    Allan
This discussion has been closed.