What's the issue with the submit button not functioning on the form?

After downloading a sample form, I encountered the following code:

  <form id="login-user"  method="post" accept-charset="utf-8" action="/home.html" class="simform">
    <div class="sminputs">
      <div class="input full">
        <label class="string optional" for="user-name">Email*</label>
        <input class="string optional" maxlength="255" id="user-email" placeholder="Email" type="email" size="50" />
      </div>
    </div>
    <div class="sminputs">
      <div class="input full">
        <label class="string optional" for="user-pw">Password *</label>
        <input class="string optional" maxlength="255" id="user-pw" placeholder="Password" type="password" size="50" />
                                <span class="hide-password">Show</span>
      </div>
    </div>

    <div class="simform__actions">
      <input class="sumbit" name="commit" type="sumbit" value = "Log in"/>
      <span class="simform__actions-sidetext"><a class="special" role="link" href="#">Forgot your password?<br>Click here</a></span>
    </div> 
  </form>

Upon clicking the submit button, it wasn't working as expected and was clicking on text inside the button instead. Changing the line to:

<button class="sumbit" name="commit" type="sumbit" value = "Log in"/>

allowed it to work but altered the CSS design.

I also wondered if CSS files can impact the functionality of an HTML page. I initially believed they only influenced the design and appearance of the form. Could it affect functionality like mentioned above?

EDIT

Below is my JavaScript code:

$("#login-user").submit(function(event){
        event.preventDefault();
        alert("Here");
        var name = $("#user-email").val();
        var pass = $("#user-pw").val();

        Parse.User.logIn(name,pass,{
            success: function(user){
                checkLogin();
                alert("Thanks for login");
                window.location.href = "/home.html";
        }, error : function(user, error){
            console.log("Login Error : " + error.message);

        }
    });

Answer №1

I truly believe this is the correct answer.

 <button class="submit" name="confirm" type="submit" value = "">
  Sign in
 </button>

Your type="submit" should be corrected.

Answer №2

My suggestion is to make the following adjustments.

<button class="submit" name="login" type="submit">Log in</button>

You can refer to this link for more information: http://www.w3schools.com/tags/tag_button.asp

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering Err_Connection_Refused while working with MVC WebAPI 2 and AngularJS

Seeking guidance on WebAPI, AngularJS, and .NET Authentication, I am currently following a tutorial mentioned HERE. The tutorial is brief (~under 10 mins), but I encountered an error stating Failed to load resource: net::ERR_CONNECTION_REFUSED. Typically, ...

How can you retrieve input values from a form using a button click but without requiring a

I am facing an issue with the delete button on my form. The form has three buttons - one to edit the form on another page, one to add a value on the existing page, and one to delete a value. While the submit and edit buttons work fine, I am struggling wi ...

Issues with align-content in Internet Explorer 11

.row { background: green; color: white; margin-top: 20px; } .col2 { border: 3px solid black; display: flex; flex-direction: column; flex-wrap: wrap; align-content: flex-end; } <link rel="stylesheet" href="https://stackpath.bootstrapcdn. ...

Include a flexible div in the hero section and change the position when resizing the screen

Looking to achieve a specific layout with only two resolutions in mind (767px minimum and maximum). For screens larger than 767px, display two divs side by side: one with text on the left and the other with an image on the right. The text remains in a fi ...

The specified property 'slug' is not found within the designated type 'ParsedUrlQuery | undefined'

I am faced with an issue in my code where I am attempting to retrieve the path of my page within the getServerSideProps function. However, I have encountered a problem as the type of params is currently an object. How can I convert this object into a stri ...

Anyone have a sample showcasing the integration of VueJS with the latest webpack 4 configuration?

VueJs templates now come with numerous examples and starting project skeletons. However, most of them still utilize webpack v3. Has anyone experimented with webpack 4? I'd love to see how you integrate version 4 of webpack into a VueJs project. Thank ...

The process of utilizing RxJS for server polling is a

My goal is to constantly update client-side data by polling the server. To achieve this, I have set up a dispatcher that triggers an action labeled FRONT_PAGE. This action is initiated when the app launches and the client is supposed to send requests every ...

Tips for launching different web browsers via hyperlinks?

My app has a link that I want mobile users from apps like LinkedIn to open in a browser such as Safari. I attempted this: <a href="safari-https://meed.audiencevideo.com">May open on Safari</a>' However, when I click the link, it opens i ...

Dynamic web elements can be easily enhanced through the use of jQuery

Upon loading a page through AJAX, I encountered the following code involving animation of a div (#1 moves it to the left and #2 moves it back): #1 $('#flipper').click(function () { $(".l-l").animate({ "left": -267 }, 600, function () { ...

I'm struggling to make this background show up in a div

Anyone able to help me figure this out? I can't seem to get the achtergrond_homepage.png as a background in rounded corners. Edit: It seems like the gray color is always on top. Could it be controlled in the JavaScript part? This is the CSS: @ch ...

Navigating through the concept of passing objects by reference in child components of Angular 2+

Understanding that TypeScript uses object passing by reference can be challenging, especially when dealing with deep copy issues. This becomes particularly cumbersome when working within a theme. I recently encountered an issue with a component containing ...

a JavaScript file containing only a require statement with a list of dependencies and a function

I have a question regarding the implementation of the "require" statement in JavaScript. I am just starting to work with JS and Dojo, and I encountered an issue while developing a Plug-in for a website. The main Java class of the plugin makes a reference t ...

Positioning a div inside another div using CSS

I'm having issues with a nested div causing trouble for me. <div style="border:solid 20px #ccff33;border-radius:10px;height:300px;width:300px;margin:20px;display: inline-block"> <img src="images/f35.jpg" style="margin-right:10px" /> ...

Confirm the value of $index and apply a specific style

Trying to figure out how to highlight a table row using AngularJS within a directive. Here is some pseudo code I came up with: if(highlight.indexOf($index) != -1) set .highlight css class Below is an example of my code snippet: $scope.highlight = [0, ...

Footnote fiascos

I am currently in the process of creating a footer for my webpage and have implemented the following CSS styling: #footer { height: 100px; background-color: #F3F3F3; position: absolute; bottom: 0; } Although the footer is displaying at th ...

What is the equivalent of appendChild in React using vanilla js?

I've previously created this pen using vanilla JavaScript. Now, I'm looking to integrate it into my React component. displayPDF(url, canvasContainer, options) { options = options || { scale: 1 }; function showPage(page) { var view ...

Finding the next div by its ID using jQuery

Currently, the jQuery code provided only allows navigation from the Sport section to the Entertainment section. Is there a way to create a script that allows navigation between any div sections with just one piece of code? <div id="topBar"> &l ...

Utilizing Regular Expressions in Vb.net for extracting telephone numbers

I have developed a code to extract mobile numbers from a web link. I have three links in a list box and I am extracting their source code using the following code. However, when I try to use RegEx to Extract Phone Numbers, I keep getting the same number re ...

How to toggle code block visibility in Angular's ngOnInit() method

I'm currently analyzing different design patterns to optimize the number of REST calls when implementing a 'save while typing feature'. To provide a general overview, in my ngOnInit() function, I have included the following code snippet (wit ...

How can I utilize VeeValidate 3's locale message JSON files without the need for Node.js or an HTTP server?

With VeeValidate 2, the locale message files are in javascript format, making it possible to use them by including <script src='./vee-validate/dist/locale/ja.js'> without needing Node.js or an Http Server. However, with VeeValidate 3, the ...