Developer forum

Forum » CMS - Standard features » How does the AUTOMATIC setting for Forms for editors template work?

How does the AUTOMATIC setting for Forms for editors template work?

Peter Leleulya
Peter Leleulya
Reply

Hi guys,

I've been notified by a customer that they see fields in their forms that "don't exist" ...

I've been investgating and found that in many cases they use the "Automatic" option for their template.

https://doc.dynamicweb.com/documentation-9/content/apps/forms-for-editors states that when this option is selected "an automatic system template" is used.

It seem to be these rendered inputs:

Strangely I don't see them when I view the page (due to a display:none!important class on the .....maps class which is on these inputs), but the customer (and probably more visitors) does!

Is this something I can fix without having to switch to a custom template?
It seems that these forms are scattered all over the website and i would like to fix the root cause in stead of offer a work-around.
How is this template rendered?
Is it based on a template in the admin section? Or db content? Or something else?

 


Replies

 
Peter Leleulya
Peter Leleulya
Reply

I did find some forms when searching on "labelCell" which is a class we don't use in our custom setup.
But they all seem to be using the Form.SystemFields value to render the hidden inputs ...

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Peter,

The "Automatic" templates are placed in the /Admin/Module/BasicForms/ folder, but you should avoid making changes to those (changes will be lost on upgrade anyway).

The extra input fields are injected by the form anti-spam feature. Those fields should not be visible in the browser unless you have some very specific css rules which overrides the display style of the input fields. Check your css (or js) for anything that might set (or remove) the display value (inspect the elements in developer tools of your browser). Also check any print styling (@media print) if the issue appears in browser print dialog or pdf generation.

Maybe you can ask the customer which browser they are using and see if you can reproduce the issue?

/Morten

 
Nicolai Pedersen
Reply

Hi Peter

It is the antispam script. You can disable antispam totally as the only option to remove them.

I cannot see how they would see those fields unless they are using Internet Explorer 1 :-).

The template is coming from admin - and yes, it is system fields that renders them.

The only issue I can see is screen readers that could read them - and the field should probably be decorated with aria- attributes accordingly.

I wonder how they see these fields - they have been around for 10 years or so, and I have never encountered that they are visible.

 
Peter Leleulya
Peter Leleulya
Reply

Thnx for your response Nicolai and Morten ...

I changed the page template and set the module template to DefaultForm.cshtml.
The frontend was obviousley changed, but the text fields where also used in this template so I thought it wouldn't be of any help ...
I switched everything back to how it was.
Because I was testing on a production environment I checked the form to be sure I didn't break anything .... and wtf ... I see the fields too !!!

The class "...maps" is not there anymore ...

I use Google Chrome (auto update, so latest) and the customer has responded they use Google Chrome as well ...

Ik can refresh what I want ... the fields are nog going away anymore ...
While before my template changes I didn't see these fields.

I opened https://twente.com/campus-cafe/aanmelden-december-2021 in FireFox and then I see it too ...


 

In my previous tests, where I did NOT see the fields, there was a style available matching the class.
How is this element style added? Maybe then I can understand how this happens ...

 
Nicolai Pedersen
Reply

Hi Peter

I can see that the form is manipulated by lastpass. So maybe that is the one removing the styles - they are usually rendered just before the _sys_email field. You can probably check the response in dev tools if it is there and last pass removes the style...?

 
Peter Leleulya
Peter Leleulya
Reply

NIcolai, I don't have last pass installed on my firefox browser, which shows the same problem: https://twente.com/campus-cafe/aanmelden-december-2021

 
Nicolai Pedersen
Reply

Yup, I can see the issue there.

There is something in their main.js that does this.

If I block that file, it is gone. What it is, I cannot tell. The js file is is 750kb gzipped!!! Something is wrong with that. Seems like it contains the .map file as base64 and a lot of other stuff as well...

Also the CSS files are extreme - so something seems mis configured in the build scripts for webpack. Also includes VUE??

 
Peter Leleulya
Peter Leleulya
Reply

OK, will have a look at that ..
This project has been hijacked for a while by some colleagues who introduced vue and other fantastic features to this application

 
Nicolai Pedersen
Reply

Sorry to hear, nice hunting!

I will see you Thursday in case you don't know...

 
Peter Leleulya
Peter Leleulya
Reply

As a quick fix, would this style be a problem for other dw features?

It hides all elements with a class name starting with dw and ending with maps

[class^="dw"][class$="maps"] {
	displaynone !important;
}
 
Nicolai Pedersen
Reply

Should be safe!

 

You must be logged in to post in the forum