HTML Old School

HTML Forms

HTML forms are used for entering data and passing to the scripts (PHP, CGI, ASP, JS, ...).

 

<form action="script.js" method="POST" enctype="application/x-www-form-urlencoded">
    
    <input type="hidden" name="field1" value="val1">

    <label for="f1">username:</label>
    <input type="text" id="f1" name="username" value="">

    <br>
    <br><label for="f2">password:</label>
    <input type="password" id="f2" name="password" value="">

    <br>
    <br>City:
    <br><input type="checkbox" id="ny" name="city" value="NY"> <label for="ny">New York</label>
    <br><input type="checkbox" id="ch" name="city" value="CH" checked> <label for="ch">Chicago</label>
    <br><input type="checkbox" id="la" name="city" value="LA"> <label for="la">Los Angeles</label>


    <br>
    <br>Country:
    <br><input type="radio" id="us" name="country" value="USA"> <label for="us">United States</label>
    <br><input type="radio" id="fr" name="country" value="FRA" checked="checked"> <label for="fr">France</label>
    <br><input type="radio" id="hr" name="country" value="CRO"> <label for="la">Croatia</label>

    <br>
    <br>Cars:
    <select name="car">
        
        <optgroup label="Swedish">
            <option value="saab">SAAB</option>
               <option value="volvo">Volvo</option>
        </optgroup>
        
        <optgroup label="German">
               <option value="mercedes">Mercedes</option>
                <option value="audi">Audi</option>
        </optgroup>

     </select>

    <br>
    <br><label for="ms">Message:</label>
    <br><textarea name="msg" id="" cols="30" rows="5"></textarea>

    <br>
    <br><input type="submit" value="Send">

</form>

 

 I recommend you to study this lessons but if you are too lasy you can always use one of online form creators .