asp.net mvc - Best way to use one control in two forms -


I am trying to create a page where a user chooses the type of subscription that he or she wants to buy and then Then enters his credit card information or clicks on the Make a payment button with "PayPal".

So far, the best way I could think of it was a single drop down where the user would select the membership type and then along with two variations (where they would enter the CC information and Second only with a big PayPal button). I reached this decision so that in one form, I ? Can I send payment type = credit card query string parameters and in the second, I ? Can I send PaymentType = Paypal ? It turns out to me to check whether the buttontext == "launches" next in the form of CC, and then redirects to PayPal.

However, seeing it as a subscription control or Then form, I can not use that type which is selected without repeating the control in both forms (which do not provide the best user experience).

A better way

Why do you need two forms for this? I definitely go with one form Because if you have two forms, they will still be doing the same thing; Contribution.

You can create two radio buttons like this

  & Lt; label id = "radiobtn-paypal" name = "PaymentType" type = "radio" value = "paypal" /> gt; label = "radiobtn-paypal" & gt; paypal & lt; / label & Gt; & lt; input id = "radiobtn-cc" name = "payment type" type = "radio" value = "cc" /> ; & Lt; label = "radiobtn-cc" & gt; Credit card & lt; / Label & gt;  

Depending on the selection, whether the credit card text box is displayed or not, and either process the credit card or take action based on the user's selection, what should you do with PayPal selection . After all, what is the html input control?


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -