HTML Form Post - Dynamic URL Issue

Hello:  Apologize in advance if this is in an existing question - couldn't find one like this.
I have the very simple code below to take a value from a text box and enter it as a donation amount to this donation site.  It works fine - except the donation company doesn't auto adjust the donation amount based on this entry.


Typing this directly into a URL changes the donation amount:
https://inspirepay.com/pay/cscc?amount=4.25

But running the code below does not ; it just either sets the box to zero which is its default or errors ; any suggestions ?

<form method="get" action="https://inspirepay.com/pay/cscc?amount=nzb" >
<input name="action" value="1.00" />
<input value="nzb" type="submit" />
</form>

Thanks for any help

Please note although html; I'm using asp.net
Brad0707Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If the code is all on the same page, then the url is being used somewhere in your code to adjust the donation.  The url in the form is pointing to where the form will post to.
0
Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
If they are on different pages, then you want to change your form to

<form method="get" action="https://inspirepay.com/pay/cscc" >
<input name="action" value="1.00" />
<input name="amount" value="4.25"
<input value="nzb" type="submit" />
</form>

Open in new window


That will end up as https://inspirepay.com/pay/cscc?amount=4.25&action=1.00
0
thehagmanCommented:
Your code willresult in a url such as https://inspirepay.com/pay/cscc?amount=nzb&action=4.25 to be invoked if the user overwrites the 1.00 with 4.25. If they expect the numerical amount in the amount parameter, this will fail.

If what you want is something like https://inspirepay.com/pay/cscc?amount=4.25, try
<form method="get" action="https://inspirepay.com/pay/cscc" >
<input name="amount" value="1.00" />
<input type="submit" />
</form>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.