skip to Main Content

I have a problem with reset and submit buttons. the buttons appear in page but when I click on it deosnt work. what is the reason !!!

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <meta descrption="This Is Description For My First Page">
    <title> Assigemnt 7 </title>
   
    <script> </script>
    <link rel="stylesheet" type="text/css" href="" > <link>

</head>


<body>
    <from  action="" target="_blank" method="get"  >
        <label for="search">search</label> <br>
        <input type="search" name="search" id="search" autofocus placeholder="enter a search word">
        <hr>
        <label for="url">Url</label> <br>
        <input type="url" required>
        <hr> 
        <label for="file">Upload</label> <br>
        <input type="file" id="file" >
        <br><br>
        <input type="reset" value="Reset">
        <input type="submit" value="Save">   
      
    </from>
</body>


</html>

2

Answers


  1. I noticed a couple of issues in your HTML code that could be causing the problem with the reset and submit buttons not working:

    • Typo: The opening form tag has a typo; it should be instead of
      . This can cause the form elements to not work correctly.

    • Missing action attribute: The form tag is missing the "action"
      attribute, which should specify the URL where the form data should be
      submitted. You can leave it empty if you want to submit the form to
      the current page.

    • Invalid link tag: The link tag in the head section is incomplete. You
      should specify the href attribute to point to the location of your
      CSS file.

    Here’s the corrected HTML code:

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="UTF-8" />
        <meta descrption="This Is Description For My First Page">
        <title> Assigemnt 7 </title>
       
        <script> </script>
        <link rel="stylesheet" type="text/css" href="your_css_file.css">
    </head>
    
    <body>
        <form action="/your_action_page.php" target="_blank" method="get">
            <label for="search">search</label> <br>
            <input type="search" name="search" id="search" autofocus placeholder="enter a search word">
            <hr>
            <label for="url">Url</label> <br>
            <input type="url" required>
            <hr> 
            <label for="file">Upload</label> <br>
            <input type="file" id="file">
            <br><br>
            <input type="reset" value="Reset">
            <input type="submit" value="Save">   
        </form>
    </body>
    </html>
    

    Make sure to replace "your_css_file.css" with the actual path to your CSS file if you have one.

    With these corrections, the reset and submit buttons should work as expected. If there are any other issues, make sure to check the browser’s developer console for any error messages that might help pinpoint the problem.

    Login or Signup to reply.
  2. your form tag’s spellings are wrong(typo). It should be <form></form> not <from></from>

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search