Hi,
The submit_tag when used created a button by default. Is there a way
by which i can create a link and use submit_tag and its properties.
I have a form submission and i want that to work as it is but instead
of button show a link in my page.
Neha
something like
link_to_function(“submit”, “$(‘form_id’).submit();”)
should work, assuming you use prototype.js
if not, replace $(…) with document.getElementById(‘form_id’)
and of course form_id has to be replaced with the actual id of your form
While using the link_to_function i am getting this javascript
Add
Term To Search
and with submit_tag i am getting thus
How can i make this work.
On Feb 22, 10:44 am, Thorsten M. <rails-mailing-l…@andreas-
??? could you post the exact code you use ???
<%= hidden_field_tag(‘commit’, ‘add_another_criteria’) %>
<%=link_to_function(“Add Term To Search”, :name => ‘_commit’,
:onclick => “Form.getInputs(this.form, null, ‘commit’)
[0].value = ‘add_another_criteria’”) %>
<%= submit_tag(‘Add Term To Search’, :name => ‘_commit’,
:onclick => “Form.getInputs(this.form, null, ‘commit’)
[0].value = ‘add_another_criteria’”) %>
On Feb 22, 11:04 am, Thorsten M. <rails-mailing-l…@andreas-