Skip to content

Commit

Permalink
modified the "How did you hear about us" field from checkboxes to rad…
Browse files Browse the repository at this point in the history
…io boxes.
  • Loading branch information
ppsahu committed Jan 17, 2025
1 parent cdea222 commit 0d21568
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions src/components/EventRegistration/TestEventRegistration.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,32 +490,33 @@ const TestEventRegistration = () => {
</div>
{/* How Did You Hear About Us Field */}
<div style={{ marginBottom: "1rem" }}>
<label htmlFor="howDidYouHear" style={{ display: "block", marginBottom: "0.5rem" }}>
How did you hear about us? <span style={{ color: "red" }}>*</span>
</label>
{[
"Search Engine (Google, Bing, etc.)",
"Social Media",
"Radio",
"Television",
"Streaming Service Ad",
"Newspaper/Online Newspaper",
"Billboard",
"Word of Mouth",
"Referral",
"Others",
].map((option) => (
<label htmlFor="howDidYouHear" style={{ display: "block", marginBottom: "0.5rem" }}>
How did you hear about us? <span style={{ color: "red" }}>*</span>
</label>
{[
"Search Engine (Google, Bing, etc.)",
"Social Media",
"Radio",
"Television",
"Streaming Service Ad",
"Newspaper/Online Newspaper",
"Billboard",
"Word of Mouth",
"Referral",
"Others",
].map((option) => (
<div key={option} style={{ marginBottom: "0.5rem" }}>
<label>
<input
type="checkbox"
name="howDidYouHear"
value={option}
onChange={handleChange}
type="radio"
name="howDidYouHear" // Shared name for all radio buttons
value={option}
onChange={handleChange}
checked={formValues.howDidYouHear === option} // Ensures correct selection
/>
{option}
</label>
{option === "Others" && formValues.howDidYouHear.includes("Others") && (
{option === "Others" && formValues.howDidYouHear === "Others" && (
<input
type="text"
name="otherHowDidYouHear"
Expand All @@ -531,11 +532,11 @@ const TestEventRegistration = () => {
/>
)}
</div>
))}
{errors.howDidYouHear && (
<span style={{ color: "red", fontSize: "0.875rem" }}>{errors.howDidYouHear}</span>
)}
</div>
))}
{errors.howDidYouHear && (
<span style={{ color: "red", fontSize: "0.875rem" }}>{errors.howDidYouHear}</span>
)}
</div>


{/* buttons */}
Expand Down

0 comments on commit 0d21568

Please sign in to comment.