0

I have a common scenario. I have a list page. There are three buttons. View, edit and delete. Each record has a radio button which selects id of that record.

    $(".radioBtn input").click(function() {
        $('#messageId').val(this.value);
    });

also I am keeping the id as hidden field to set it in the form object

    <form:form id="messageForm" commandName="message">
            <form:hidden path="messageId" id="messageId" />
    </form:form>

When I click on any radio, it is set in form object. Now different action needs to be invoked on clicking of view or edit or delete button. I can't user ajax. I need to call them by plain javascript so that i can render the result in different page returned by view of ModelAndView.

Can anyone help?

4
  • Do you have this three buttons (view, edit, delete) for each item in the list (so when the list has 5 items, you have 15 buttons in total)? Commented Mar 5, 2014 at 17:51
  • no. buttons are at the end of the page. only three buttons. It all are working fine. I just need to submit the form with javascript. i am trying to get document.form.action to hold action mapping name and document.form.submit() to submit it but it ain't working. Commented Mar 5, 2014 at 17:55
  • But why do you submit the from with java script when you want to display the returned html. Instead you could submit the form with a normal html submit button, then the browser will render the returned html, so there is no javascript needed? Commented Mar 5, 2014 at 18:03
  • javascript was needed because i have multiple buttons. html submit is linked with a particular action. Nevertheless I got the solution. stackoverflow.com/questions/9665054/…. Ralph, thanks anyway man. Commented Mar 5, 2014 at 18:31

0

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.