My the 'name' Text isn't showing up in the form boxes... can anyone help troubleshoot | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

My the 'name' Text isn't showing up in the form boxes... can anyone help troubleshoot

<html> <head></head> <body> <!--Forms Section--> <div style="background-color:navy; color:white; padding:5%;"> <h1 align="center">OH yeah FORM time!!!!</h1> <span style="color:black;"><p>This form uses the "GET" method which displays form data in the address bar</p> <form action="welcome-to-the-matrix.html" method="GET"> <input type="text" name="username"/><br/> <input type="password" name="password"/><br/> <input type="submit" name="I Choose the Red Pill"/> </form> <p>This form uses the "POST" method which <ins><i>DOES NOT</ins></i> displays form data in the address bar</p> <form action="welcome-to-the-matrix.html" method="POST"> <input type="text" name="username"/><br/> <input type="password" name="password"/><br/> <input type="submit" name="I Choose the Red Pill"/> </form> </span> <div> </body> </html>

2nd May 2020, 8:53 AM
Matthew Harrison
Matthew Harrison - avatar
2 Answers
+ 3
Replace all 'name' attribute with 'value' attribute like so : value="I Choose The Red Pill" 'name' attribute is used to give a name of the input so that you can access it later and get it's value. And 'value' attribute is used to give a value of the input which will be shown in the screen!
2nd May 2020, 9:14 AM
Arb Rahim Badsa
Arb Rahim Badsa - avatar
+ 1
Brilliant! thankyou sir!
2nd May 2020, 9:25 AM
Matthew Harrison
Matthew Harrison - avatar