Hi-

I'm using the filter forms generated by the Admin Generator in Symfony
1.2, and I wanted to change the 'Reset' link to a button.  I've tried
changing the link_to function to a 'button_to, but this does not seem
to work.  My link_to code looks like:

<?php echo link_to(__('Reset', array(), 'sf_admin'),
'status_line_post_collection', array('action' => 'filter'), array
('query_string' => '_reset', 'method' => 'post')) ?>

and it generates the following HTML:

<a onclick="var f = document.createElement('form'); f.style.display =
'none'; this.parentNode.appendChild(f); f.method = 'post'; f.action =
this.href;var m = document.createElement('input'); m.setAttribute
('type', 'hidden'); m.setAttribute('name', '_csrf_token');
m.setAttribute('value', '7abffc03168645308dfd4072403d93f2');
f.appendChild(m);f.submit();return false;" href="/post/filter/action?
_reset">Reset</a>

If I change the function to button_to:

<?php echo button_to(__('Reset', array(), 'sf_admin'),
'status_line_post_collection', array('action' => 'filter'), array
('query_string' => '_reset', 'method' => 'post')) ?>

the resulting HTML is:

<input action="filter" value="Reset" type="button"
onclick="document.location.href='/post/index/action';" />

which fails to perform the action identically to the link_to.  Are
there any workarounds to this issue?

Thanks,
Todd
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to