1

I have this problem :
I have a submit button defined as follows :

 <input  type="submit" name="actionName" value="search" />
 <input  type="submit" name="actionName" value="New" />

both submit buttons are included in an Ajax beginForm:

@using (Ajax.BeginForm("PFSearch", "Payer", ajaxOptions))

In the controller ... based on the actionName string provided .. i do different actions based on the value of button pressed within my Ajax befin form :

if (actionName="search")
{
//do something
}

And everything works like a charm .. until i want to add i want to add an image to the class of my submit button :

  <input class="search" type="submit" name="actionName" value="search" />
  <input class="search" type="submit" name="actionName" value="New" />

My search tab looks like this : enter image description here
As you can clearly see my main impediment is that by adding value ... the text appears over my image.
How can i make those button act differently within my ajax begin form considering that giving value to the buttons doesn't work ? Any alternatives or workarounds are appreciated. Thanks !

2
  • use image-tags, a hidden input field and an onclick-event with which you write in the hidden field which image was clicked and submit the form Commented Jun 5, 2012 at 14:55
  • <input class="search" id="btnNew" type="submit" name="actionName" actionname="New" /> and i added : <img class="search" onclick="function(){$('#btnNew').click();}" /> but i get this error : Error: function statement requires a nameSource File:function(){$('#btnNew').click();} Commented Jun 5, 2012 at 15:10

1 Answer 1

1
+50

Can you please give us a link to your project's demo? And try to use some margin, padding and background-position:center;

Sign up to request clarification or add additional context in comments.

3 Comments

Its not a css issue ... it a mvc one... I'll remove the css tag
I think you'll find it is a CSS issue?
my bad ... actually ... this was the ay to do it :bumpinthehead. Thanks ! I'll award bounty in 3 hours ( at least thats what the message said when i tried)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.