Monday, 9 January 2017
php - On submit, echo 'selected' on the right option of a select tag if form return false
Answer
Answer
I got an issue right now, and I really don't understand why, lol. Let me explain it!
What I want to do : If form has been submitted and return false, take "correct" values within the form and place it into his right input value so that the customer won't fill it again. (In this situation, it's about a select tag with many options)
What it's doing : Well, when I click on submit, my option selected it's ALWAYS the value 3 (5 ans et plus) but when I try to echo out $_POST['depuis'], it is the right value that echos out.
Here's my partial script :
Answer
Replace
if(isset($_POST['depuis']) == '0')
with
if(isset($_POST['depuis']) && $_POST['depuis'] == '0')
and so on...
Subscribe to:
Post Comments (Atom)
c++ - Does curly brackets matter for empty constructor?
Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...
-
Iv'e read a lot of posts both in stackoverflow and other websites talking about web security. Such as salting encrypting etc. ...
-
System.out.print("Name : "); String name = in.nextLine(); System.out.print("Age : "); int age = ...
-
I would like these values to go into my database but it just won't do it. Form Code Navn: Tilføj til dine præferencer...
No comments:
Post a Comment