form submit after preventDefault not working until submit button is clicked a second time
Date : March 29 2020, 07:55 AM
around this issue WORKING FIDDLECODE $(document).ready(function(){
$('#form1').submit(function(e) {
var form_ok=$(":text").val().length>0;
if(!form_ok)
{
e.preventDefault();
}
});
});
<form id="form1">
<input type="text" />
<input type="submit" value="Submit" />
</form>
|
Submit button must be clicked twice to Submit form - Java Script fix not working
Date : March 29 2020, 07:55 AM
I wish this helpful for you My form submit button has to be clicked twice before the form will submit. My professor gave me some Java Script code, which I've implemented below, that will click the submit button twice automatically, but it is not working. , So here is hot it would be your form part <form name="com" id="com" action="leavehandle.php" method="post">
<!DOCTYPE html>
<html> <!--Opening HTML tag-->
<div align="center"> <!--Aligns content center-->
<head>
<?php //pulls in my header from another PHP page using Inlcude()
include("header.php");
?>
</head>
<style>
html {
font-family:arial;
background-color:#ffcc99;
}
</style>
<body>
<?php
include('mysqli_connect.php');
//set vars to null
$fname = $lname = $email = $comment = "";
//validade post
if(!empty($_POST['fname'])&&!empty($_POST['lname'])&&!empty($_POST['email'])&&!empty($_POST['comment'])) {
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$email = $_POST['email'];
$comment = $_POST['comment'];
$query = "INSERT INTO guestbook (id, email, fname, lname, date, comment) VALUES (NULL, '$email', '$fname', '$lname', NOW(), '$comment');";
$result = mysqli_query($dbc, $query);
} else {
//redirect to error page is is null
header("Location: leave.php");
}
if ($result) {
echo "Thank you for submitting a comment $fname!";
}
else {
echo "ERROR";
}
?>
</body>
<?php //pulls in my footer from another PHP page using Inlcude()
include("footer.php");
?>
</div>
</html>
|
submit break point in Chrome not working as expected with jQuery submit
Date : March 29 2020, 07:55 AM
it fixes the issue The debugger is stopping in the jQuery library because it's the first bit of code to execute as a result of the native submit event. jQuery handles that event, and then delegates the remaining handling code to you. If you continued to step through the code, you'd eventually get to your own handler. To avoid this, you can blackbox the jQuery library in the debugger. This will prevent it from stopping in the jQuery code, and go straight to your own code.
|
Form submit after preventDefault not working until click submit button
Date : March 29 2020, 07:55 AM
With these it helps It is because #loginFormDiv is a
|
Submit Button is not working. When i click on submit after put information in the field it doesn't do anything.
Tag : chash , By : Webtoad
Date : March 29 2020, 07:55 AM
|