“Formen Sie Aktion in HTML” Code-Antworten

Aktionsformular für diese Seite in HTML

<form action="#" method="GET">
  <label for="username">Username:</label>
  <input type="text" id="username" name="username" required>
  <input type="submit">
</form>
Powerful Piranha

Formen Sie Aktion in HTML

<!--Answer from W3 Schools-->
<form action="/action_page.php">
  <label for="username">Username:</label>
  <input type="text" id="username" name="username" required>
  <input type="submit">
</form>
Old Pizza

HTML Form Aktion JavaScript -Methode

A form action set to a JavaScript function is not widely supported, I'm surprised it works in FireFox.

The best is to just set form action to your PHP script; if you need to do anything before submission you can just add to onsubmit

Edit turned out you didn't need any extra function, just a small change here:

function validateFormOnSubmit(theForm) {
    var reason = "";
    reason += validateName(theForm.name);
    reason += validatePhone(theForm.phone);
    reason += validateEmail(theForm.emaile);

    if (reason != "") {
        alert("Some fields need correction:\n" + reason);
    } else {
        simpleCart.checkout();
    }
    return false;
}
Eager Elephant

Ähnliche Antworten wie “Formen Sie Aktion in HTML”

Fragen ähnlich wie “Formen Sie Aktion in HTML”

Weitere verwandte Antworten zu “Formen Sie Aktion in HTML” auf HTML

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen