Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:

Swift
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900