test this form for me please

Joined
12 Feb 2006
Posts
17,312
Location
Surrey
http://www.mayergroup.co.uk/online-quote/cleaning/?service=moving

if you have a spare moment can you take the time to go through this quote form and let me know if you have issues with the date thinking you've input 01/01/1970?

when going through the form can you use the name as TEST OCUK or something like that so i know it's not for a real customer and to not chase you up :p

ive tested as best i can and never have issues with the date, but every now and again i get a customer say that when they input a date it shows as 01/01/1970 once they try to go to the next step even though they select something in the future.

i'd appreciate if you can try this, and let me know which browser/os you're using.

i know the last person to tell me they had the issue, they said the date pop up didn't come up and they had to input the date by hand, but did use the format i show but still had the issue.
 
Soldato
Joined
16 Jun 2013
Posts
5,375
How are you initially setting the date field?

01/01/1970 is phps fallback date if it can't read the UNIX time iirc.

O I tried and had no issues on mobile safari nor Firefox desktop.
 
Soldato
OP
Joined
12 Feb 2006
Posts
17,312
Location
Surrey
"Postcode: T3ST1CL" :D


this is the variety of code related to the date field.

PHP:
<input type='date' name='date' id='date'  value='<?= $date; ?>' min="<?php echo date("Y-m-d") ?>" />

PHP:
$date = stripslashes(htmlspecialchars($_POST['date'], ENT_QUOTES));

PHP:
<input type='hidden' name='date' id='date' value='<?= $date; ?>' />

PHP:
if (strlen($date)>0 && strtotime($date) < time()) {

$dateShown = strtotime($date);
$dateShown = date('d/m/Y', $dateShown);

$error++;
$errorMessage .= "<label for='date' title='Click to jump to the error'>- Date $dateShown selected is in past. Please correct to dd/mm/yyyy format</label>";
$dateRed = "class='e tooltip' title='Date selected is in past. Please correct to dd/mm/yyyy format' ";
}


annoyingly i'm yet to find a way to replicate the issue, but it certainly is one. I feel it's when the html input date thing can't work on certain browsers but i don't know which.
 
Last edited:
Associate
Joined
17 Jan 2003
Posts
1,058
On Chrome desktop it seemed to work but why not use a datepicker ?

Much more convenient

Also removals date is inconsistent (no "template") and

"Which Estate / Letting Agent manages this property? (optional):"

says "(Select One)" but there is no selection

The breadcrumb overlays the title if you resize the browser
 
Soldato
OP
Joined
12 Feb 2006
Posts
17,312
Location
Surrey
ok so i've prevented the check that doesn't let past dates through, now i'm getting loads of past dates.

i've got the user agent info sent in the quote so i can see what the user is using and find how this error is being made.

this is what the user info gave for the latest happening.

User: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18

it's muddling the date around. should be 01/09/16 but it comes through as 09/01/16. no idea why. anyone with the same stuff able to try for me?
 
Soldato
OP
Joined
12 Feb 2006
Posts
17,312
Location
Surrey
no idea. how should i check? the dates work fine for all browsers i try it with and those who tried on here. should i be defining that the date is a uk date when splitting it or something? i suspect it's an issue from apple computers.
 
Soldato
Joined
3 Jun 2005
Posts
3,117
Location
The South
...but why not use a datepicker?
No all browsers support the date input type plus there are known issues with the min/max parameters so a dedicated datepicker is the better solution. Plus a lot of them will handle locale date support so you'd just supply Ymd (ideally how dates should be formatted and handled internally) and it'll handle the rest including returning the date in Ymd.

I have however noticed that the min parameter isn't correct and an extra value is being added to the string. It might also be worth closing the PHP line correctly, ie -
Code:
min="<?php echo date('Y-m-d')[B];[/B] ?>"
Although realistically i'd have thought you'd set the minimum value a few days away from the current date for headroom/lead-in/time to reply etc.

And unless you're dealing with DateTime then don't bring time into the equation when comparing dates because in most situations it'll fail.

Also make sure you're sanitising and validating the date POST data before doing any processing on it.
 
Back
Top Bottom