Computer scienceFrontendHTMLForms

Hidden form fields

Referral program

Report a typo

You are working on a website with a referral program. When users refer others, you want to track the source of the referral using hidden form fields. Modify the HTML code below to achieve the same scenario.

Write HTML and CSS code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Referrals</title>
</head>
<body>
<h2>Referral Program</h2>
<form action="process_referral.php" method="POST">
<input name="referrer_546" value="ref_alex" id="referral">
<label for="email">Friend's Email:</label>
<input type="email" id="email" name="email" required>
<input type="submit" value="Refer a Friend">
</form>
</body>
</html>

Completed 1 of 2
Implement hidden form field in referrer tag.
The code is valid.
___

Create a free account to access the full topic