[TYPO3-mvc] HMAC check fails / form view helper

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Mon Sep 26 13:55:21 CEST 2011


On 09/26/2011 12:49 AM, Claus Due wrote:
> Hi Till,
>
> On Sep 26, 2011, at 12:28 AM, g4-lisz at tonarchiv.ch wrote:
>
>    
>> Hi,
>>
>> I already wrote to this list concerning this issue, but i got now answer.
>>      
> That happens sometimes, I apologize for that.
>    
No problem ;)
>    
>> This time i try to describe the solution i'm looking for more precisely.
>>
>> Normally the form view helper can be used in a search form like this (e.g. with select input type):
>>
>> <f:form name="demand" object="{demand}" action="results">
>> <f:form.select property="city" options="{cities}" optionLabelField="name" />
>> <f:form.submit value="Search" />
>> </f:form>
>>
>> (Class "demand" has a property "city"; A list of all cities is attached to the view as "cities".)
>>
>> I don't like the drop-down (select) input type for my purpose. A list (ul) with all city's names as links to click on would be more straight forward.
>>
>> Is there a way to get this working?
>>      
> Absolutely. HMAC safe too. I suggest using DHTML:
>
> <f:form.hidden property="city" id="someid" />
> <ul>
> <f:for each="{cities}" as="city">
>    <li><a data-value="{city.id}" href="javascript:;" onclick="jQuery('#someid').val(jQuery(this).attr('data-value');">{city.name}</a></li>
> </f:for>
> </ul>
>
> ...but you may want to use another way of DHTML'ing the above. Possibly also add a check for the selected city and set a class for the relevant city link for highlighting.
>    
I already tried something similar 
(onClick="$('#input_city').val('{city.uid}');$('#search_form').submit();") 
but it didn't work neither.

For some reason the form.hidden view helper in your code doesn't accept 
the property assignment. I.e. the rendered HTML just looks like this:
<input id="input_city" type="hidden" name="" value="" />

Cheers,
Till


More information about the TYPO3-project-typo3v4mvc mailing list