- #1
mathmari
Gold Member
MHB
- 5,049
- 7
Hey!
I have a checkbox with radio button and I want that a popup message is shown if we have selected the second option. I tried to do that with if statement but it doesn't work. How do we write the if statement in React? Isn't it 'condition ? true : false' ? Do we not check if the value or the id is the one of the correct option?
And also how is the popup message defined?
The part for the radio buttons that I used is :
I want that if we select the answer 'Yes' then a pop up message should appear.
As for the pop up I tried:
But this just makes visible or invisible respectively the part in <div>. How does a pop up window appear?
I have a checkbox with radio button and I want that a popup message is shown if we have selected the second option. I tried to do that with if statement but it doesn't work. How do we write the if statement in React? Isn't it 'condition ? true : false' ? Do we not check if the value or the id is the one of the correct option?
And also how is the popup message defined?
The part for the radio buttons that I used is :
JavaScript:
<input type="radio" id="No" value="No" name="answer" /> No
<input
type="radio"
id="Yes"
value="Yes"
name="answer"
style={{
marginLeft: '55%'
}}
/>
Yes
I want that if we select the answer 'Yes' then a pop up message should appear.
As for the pop up I tried:
JavaScript:
<Popup trigger={<button> Trigger</button>} position="right center">
<div>Popup content here !</div>
</Popup>
But this just makes visible or invisible respectively the part in <div>. How does a pop up window appear?
Last edited: