0

I've simple asp form in which I get few text fields, these values are stored in hidden fields. On button click I call post method as

<form method="post" action="https://test.mydomain.com/payment/AcceptRequestServlet"

this is working as desired. Now I got another requirement that based on a choice (captured through radio button) I should post to another url

e.g If option 1 then 
     <form method="post" action="https://test.mydomain.com/payment/AcceptRequestServlet1"
    If option 2 then
     <form method="post" action="https://test.mydomain.com/payment/AcceptRequestServlet2"

Is it possible to implement this.

1
  • From the question so far, this is either pure client-side, or Java platform. Why is it tagged ASP.NET and VS2012? Commented Oct 28, 2014 at 16:10

1 Answer 1

1

You can switch form action using javascript.

 if(case1)
  {
   document.myform.action ="https://test.mydomain.com/payment/AcceptRequestServlet1";
  }
  else

  {
    document.myform.action ="https://test.mydomain.com/payment/AcceptRequestServlet2";
  }

Assuming form is myform.

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.