formaction एट्रिब्यूट का उपयोग <button> या <input type="submit"> पर करके फॉर्म के डिफ़ॉल्ट action को ओवरराइड किया जा सकता है। यह निर्दिष्ट करता है कि फॉर्म सबमिट होने पर डेटा कहां भेजा जाए।
उदाहरण
निम्न कोड से formaction एट्रिब्यूट लागू करें:
<!DOCTYPE html> <html>
<head>
<title>HTML formaction attribute</title>
</head>
<body>
<form action="/new1.php" method="get">
छात्र नाम: <input type="text" name="name"><br>
छात्र विषय: <input type="text" name="subject"><br>
<button type="submit">सबमिट</button><br>
<button type="submit" formaction="/new2.php">दूसरा पेज</button>
</form>
</body>
</html>
पहला बटन /new1.php पर सबमिट करेगा (फॉर्म का डिफ़ॉल्ट एक्शन), दूसरा /new2.php पर।