The input value attribute specifies an initial value for an input field:
autocomplete="on" in form, list with <datalist> for suggestions, readonly for product name, disabled for coupon, and autocomplete="off" for CVV.
<!DOCTYPE html> <html> <head> <title>Checkout Form Practice</title> </head> <body> <h2>Product Checkout</h2> <form action="/order.php" autocomplete="on"> <label for="cname">Customer Name:</label><br> <input type="text" id="cname" name="cname"><br><br> <label for="city">Select Delivery City:</label><br> <input list="city-list" id="city" name="city" placeholder="Type or select city..."> <datalist id="city-list"> <option value="Delhi"> <option value="Mumbai"> <option value="Pune"> <option value="Kolkata"> </datalist><br><br> <label for="item">Product (Readonly):</label><br> <input type="text" id="item" name="item" value="MacBook Air M2" readonly><br><br> <label for="promo">Promo Code (Disabled):</label><br> <input type="text" id="promo" name="promo" value="WELCOME500" disabled><br><br> <label for="cvv">CVV Code (Autocomplete Off):</label><br> <input type="password" id="cvv" name="cvv" autocomplete="off"><br><br> <input type="submit" value="Place Order"> </form> </body> </html>
autocomplete="on" speeds up form filling for users. The list attribute provides dynamic location suggestions, while readonly keeps submitted data fixed. The disabled attribute completely locks inactive elements, and autocomplete="off" prevents sensitive card details from being cached in the browser.