vadnica-logo
X

The <fieldset> Tag

The <fieldset> tag is used to group related elements in a form. The <fieldset> tag draws a frame around the grouped elements.

EXAMPLE
RESULT

Default values in the input fields (value="HTML", value="CSS", value="JavaScript") are only displayed as initial text. When the user changes the values in any of these fields, the system will send the new entered values to the server when the form is submitted, and those values will be used. Learn more about working with PHP on my PHP page.

        

<?php
// PHP logic for form handling
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Get form data
    // htmlspecialchars prevents malicious code (XSS protection)
    $html = htmlspecialchars($_POST['html']);
    $css = htmlspecialchars($_POST['css']);
    $js = htmlspecialchars($_POST['js']);

    // Output entered data
    echo "<div style='margin-top: 20px;'>";
    echo "<p>You entered: <strong>$html</strong></p>";
    echo "<p>You entered: <strong>$css</strong></p>";
    echo "<p>You entered: <strong>$js</strong></p>";
    echo "</div>";
}
?>
        
    

Thank you for visiting! Adding privacy policy.

© 2024 All rights reserved.

Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.