Topic: Don't get value from datepicker in PHP
Expected behavior I don't get the value from datepicker in php variable $_REQUEST / $_POST
Actual behavior
Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/standard/gerdhuber/2868576
Grzegorz Bujański staff answered 4 years ago
There is no element in your form that will trigger the submit.
You can add <button type="submit">
or try the solution from this snippet: https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/2869822#js-tab-view
gerdhuber pro commented 4 years ago
Thank you for answering.
I have created now the full from with buttons. Please see https://mdbootstrap.com/snippets/standard/gerdhuber/2870051
I got values in php from the first and the third field, but not from the datepicker.
What is the problem?
Grzegorz Bujański staff commented 4 years ago
Unfortunately, I can't get into this snippet. I get an error. You probably didn't click publish. I modified the snippet and I can see that I can get the value after submit without problem: https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/2869822#js-tab-view
gerdhuber pro commented 4 years ago
sorry, i published it now.
gerdhuber pro commented 4 years ago
Hallo,
can you please help me, thank you.
Grzegorz Bujański staff answered 4 years ago
Check out this snippet: https://mdbootstrap.com/snippets/standard/grzegorz-bujanski/2878059
gerdhuber pro commented 4 years ago
I can't open the snipped, pleae have a look, thanks.
Grzegorz Bujański staff commented 4 years ago
Sorry about that. I fixed the link. Check now.
gerdhuber pro answered 4 years ago
Thank you for the correct link.
I have made more tests, see the results. whre can i send you my php-file?
image1: here you can see the array $_REQUEST and his values, which the emtpy datepicker
image2: head-section
image3: body-section
image4:
image5: here i see the values, with the java.log
gerdhuber pro answered 4 years ago
Did you understand my behavior, do you need more information from me?
Gerd
Grzegorz Bujański staff commented 4 years ago
These screenshots show me nothing that would work incorrectly. I see that you added two inputs in the form and log returns you the values of both. What is wrong in this case?
gerdhuber pro answered 4 years ago
Hallo,
i have found the error. I have to put
name="exampleDatepicker4"
and it works. Please correct your examples, thank you.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: MDB Standard
- MDB Version: 3.2.0
- Device: PC
- Browser: FireFox
- OS: win10
- Provided sample code: No
- Provided link: Yes