0

I am facing this bizarre problem in my asp.net mvc application: In one page I am showing a table full of data of a model class. Each row of data has a Edit image <img src='somesrc' onclick='fnClick({mode:'edit',..other params});/>'.

In addition to that I've Add button also to populate the same model class mentioned <a href='#' onclick=fnClick({mode:'add'});>Add</a>.

I am using a form which I use both for Edit and Add operation, and I call same function written in jQuery for these two operations. This function is passed with a mode param depending on which button is clicked. This mode is used to either populate the values on edit or opening blank form for add. Now on the page if I click Edit first and then add, the add operation still shows the data of the Edit form. Is this a cache issue or something I'm missing

1 Answer 1

1

When you click the add button, find the form element, and reset it:

#('#myformid')[0].reset()
Sign up to request clarification or add additional context in comments.

Comments

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.