Click here to Skip to main content
14,272,050 members
Rate this:
Please Sign up or sign in to vote.
I'm trying to create a signup page and what I want is when user forget to choose an option and select signup button must get alert "Firstly Select one option from above"

What I have tried:

else if !isValidEmail(testStr: email.text!)
        {
            let alert = UIAlertController(title: "Alert!", message: "Please enter correct Email ID", preferredStyle: .alert)
            alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
            self.present(alert, animated: true)
            return
        }

        else if (yes == 0)
        {
           // Here it is
            //How to show alert if radio button is not selected
        }
Posted
Comments
Richard MacCutchan 28-Nov-18 8:04am
   
Test which radio button is selected, and if none then present the alert.
Member 14070271 28-Nov-18 8:16am
   
any link or any piece of code will be more helpful
Richard MacCutchan 28-Nov-18 8:19am
   
What is the difficulty? You already have a sample of how to post an alert in the code above. Check the documentation for how to test the value of a radio button.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month



CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100