Adding "Extras" to the captcha field


(Mark Nearhos) #1

Is there a way of adding "Extras" (eg class, HTML5 attributes) to the captcha field in a custom form, like you can do in a normal text field?

 

(Matrix 4.14.2)


(Nic Hubbard) #2

The only way you could do that is with javascript.


(Mark Nearhos) #3

Thanks for that Nic - that was the path that I was going to follow.
However I saw this post in the HTML 5 Form topic by Bart and just used the replace keyword modifier to change the class and add other HTML5 attributes.
 

%form_captcha_field^replace:class=\"sq-form-field\":class="form-control" required placeholder="Type the characters you see in the picture above"%

(Mark Nearhos) #4

You could also use the replace_keywords modifier to use the %form_captcha_label% as the placeholder:

%form_captcha_field^replace_keywords:replace:class=\"sq-form-field\":class="form-control" required placeholder="{form_captcha_label}"%

(Nic Hubbard) #5

Nice one!