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);
}
});