HTML 5 forms


(Keith Bartholomew) #1

I was following this presentation by the esteemed Dave Letorey, on using HTML 5 forms in Squiz.

 

http://www.slideshare.net/OpenSourceCMS/html5-forms-in-squiz-matrix-dave-letorey

 

The problem I am having is that when I use the HTML 5 field types such as "tel" and the form gets completed with errors, on reloading those fields are empty and so require being filled out again.

 

Has anyone experienced this before?

Or know of a workaround?


(Nic Hubbard) #2

What Matrix version?


(Keith Bartholomew) #3

Thanks NIc. v4.12.2


(Nic Hubbard) #4

Thanks NIc. v4.12.2

 

How are you printing the field for this? I assume this is for a Custom Form?


(Bart Banda) #5

If you are hardcoding the input tag you will need to somehow print the post into the value as a default value as well if you want the value there when there are server side errors and the form shows the same page again, it's pretty ugly.

 

You could maybe try and use a keyword modifier to change the type="text" value to type="tel" instead. 

 

So maybe:

%question_field_<parent_id>_q<question_id>^replace:type=\"text\":type=\"tel\"%

Also, an FYI, is that we have added support for HTML5 form fields in the latest versions of matrix: http://manuals.matrix.squizsuite.net/patches/4.18.3 

Unfortunately the manuals haven't been updated yet to reflect this afaik. 


(Keith Bartholomew) #6

Thanks Bart - that worked.

 

I just had to take the backslashed out of the replaced text, so:
%question_field_<parent_id>_q<question_id>^replace:type=\"text\":type=tel%