I am having a form like this
<form name="test" action="test/test_new" />
<input type="text" />
<input type="submit" value="search"/>
<input type="button" value="download"/>
I need a click even for download button. Eg. If i click download it should submit as text/text_new.xls
instead of text/text_new
. How can i do it.
Give id to button and try this
$('#downloadButton').click(function(){
$('form[name=test]').attr('action','test/test_new.xls');
$('form[name=test]').submit();
});