1

I have 2 radio buttons 1 to to accept the work and give an option for file upload and on second button the file upload option will not be given

On click of submit this data is saved in the database

i wrote ajax function for this as follows:

 $(document).ready(function () { $('#rmrkRjct').click(function () { var url1 = "/Mycontroller/function1"; $.ajax({ type: "POST", url: url1, success: function () { } }); }); 

this is calling my function bt does not show me updated view

1
  • Could you please provide more info. Commented Jun 30, 2012 at 8:53

1 Answer 1

2

You don't seem to be doing much in your success callback. It's empty. So when the AJAX request completes this emptiness gets executed and you get the expected result: nothing happens. If the controller action that you have invoked returns some partial view you might want to refresh your DOM with it:

success: function (result) { $('#id_of_some_element_that_you_want_to_refresh').html(result); } 
Sign up to request clarification or add additional context in comments.

5 Comments

I am doing this inside the table where only on selection of approve redio button, i need to show the row which include option for uploding the file....can u help me with that
What do you want to show/update on this row? From what I can see right now your controller action returns a full View, so it is unlikely that it is adapted for AJAX.
i need to show the file upload option only on click of Approve radio button if reject is clicked , that option shd not be shown....
Why are you using AJAX? Can't you simply use .hide()/.show() directly on the client?
:I tried that earlier bt it gives me a hollow space on form at starting

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.