0

Hi created php page with input form and validation. The problem is that when i click on submit the validation works but the form is not submitted... Anyone can help me to understand where is the problem?

[https://jsfiddle.net/892wm47t/][1]

6
  • 1
    where is the validation code (javascript)? Commented Apr 12, 2022 at 14:32
  • If you want the data to be delivered to submitted.php then why not use the <form method="post" action="submitted.php" attribute to do it Commented Apr 12, 2022 at 14:34
  • Now you have thrown away the HTML and PHP you had originally Commented Apr 12, 2022 at 14:37
  • because when i click on submit it doesn't validate... Commented Apr 12, 2022 at 14:38
  • the problem is that here i cannot paste all the code... it says that it's too much code... Commented Apr 12, 2022 at 14:39

1 Answer 1

1

e.preventDefault(); stops the submission from completing. You're calling it on every attempt to submit the form.

You need to call it conditionally; only when the validation reports a problem.

Sign up to request clarification or add additional context in comments.

4 Comments

this platform is incredbile impossible to add a full case: have a look here: jsfiddle.net/892wm47t
@developmentcpm2022 — That seems to be the same code. You don't seem to have implemented this answer at all.
in the jfiddle file you can see all the replicated code.. so all completed code
What's your point? This answer is still what you need to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.