Issue Bug Closed

#20391No Underscores in Name-Attribute of FORM-Object (Typoscript)?

Andre Dittmar 05/04/09, 17:49 updated 09/09/13, 11:01

Description

I create a form in Typoscript like

lib.myform = FORM
lib.myform {
formName = my_form
method = get
action = someformaction.php
// some more parameters
}

The result is:
<form action="someformaction.php" id="myform" name="myform"> <p>Typo3 changes “my_form” into “myform”? The same happens if I use <br>“my-form”, camel-case like “MyForm” works well… I need that specific <br>name for a 3rd-Party javascript function, otherwise I would just use <br>any name. I’m just wondering why Typo3 changes the name? As far as I <br>know, are underscores permitted in name-Attributes? There is also no <br>advice in the TSConfig for the parameter formName, it’s just expected <br>as a string…</p> <p>tslib_content:</p> <p>function FORM:</p> <p>if ($conf[‘formName’]) {<br> $formname = $this-&gt;cleanFormName($conf[‘formName’]);<br>}</p> <p>function cleanFormName($name) {<br> // turn data[x][y] into data:x:y:<br> $name = preg_replace(‘/\[|\]\[?/’,’:’,trim($name));</p> <p>
// remove illegal chars like _
return preg_replace(‘#[^:a-zA-Z0-9]#’,’‘,$name);
}
</p> <p>Thanks for Jan Bednarik for analyze and reserach…<br>(issue imported from #M11030)</p></form>

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.