form_for not rendering :html => {}

Hi I am trying to disable chrome’s html5 validations. I have added
:html => {:novalidate => ‘novalidate’}

``

to the form tag but when I check the form in the browser it is not there and the validations keep me from submitting the form.

Here is all the relevant (I think) code.

Enter code here…form_for(:customer, url: {:action => ‘update’, :id => @customer.id, :account_settings => true},:html => {:novalidate => ‘novalidate’}) do |f|

``
= render(:partial => ‘form’, :locals => {:f => f})

And this is what the form shows in HTML

``

Thank you.

Are you saying the form tag does not show at all?
Is it ok in a different browser?
Have you got the = sign?
<%= form_for...

Colin

Sorry I put the wrong line of HTML, the form works:

Here it is in Chrome

<form accept-charset="UTF-8" action="/customer/5" method="post">

What is interesting is that in Firefox the tag shows up and works fine:

<form accept-charset="UTF-8" action="/customer/5?account_settings=true"
method="post" novalidate="novalidate">

Sorry I put the wrong line of HTML, the form works:

Here it is in Chrome

<form accept-charset="UTF-8" action="/customer/5" method="post">

Is this looking at the raw HTML, or the rendered DOM? Chrome *might* be being pedantic here, and refusing to show GET attributes in a POST form. I recall somewhere in the mists of time that while that may work, it may also not be *standard* and thus a conforming UA would be within its rights to drop it, since POST trumps GET in all cases. See if the form works uniformly when you add a hidden field to it with :account_settings as the name, and remove the querystring from the form action. If you add that with a f.hidden_field helper, then you will need to change your controller to access the attribute from within the parent object's params hash, i.e.: params[:customer][:account_settings] rather than params[:account_settings].

Walter

Further to this a good plan is to copy/paste the complete generated
html into the html validator
https://validator.w3.org/#validate_by_input

Often when different browsers behave differently for the a site is it
down to invalid html, which the two browsers are interpreting
differently.

Colin