I have to build up a NodeJS/React website. The website is all about users posting their events. So while the user is adding his event he has an option to add registration link of the event (link to the third party website where they can directly apply). Adding registration link is handled simply with the input field. Where I ask for the link:
const AddEvent = () => {
return <input type="text" name="registrationLink" />;
};
Where I show the link:
const EventInfo = props => {
const { registrationLink } = props; // i.e this outputs https://www.google.com
return <a href={registrationLink}>Register Now</a>;
};
How can I now validate input to only accept the links (i.e only links with https)? Is there any easy way to do this? Best!