![]() |
Donate page
ver - 4.1.12
Ok so I have a donate page on a site I built. Right now I just left the price blank so they can enter an amount in. Is there a way to have a drop down with various amounts AND the empty text box as an other option? |
Re: Donate page
You can. Just do a check after submit - if textbox empty use the amount from dropdown else use the amount from textbox. Also have to do check textbox allows numbers only. You have to do js client side check but also server side check in case js is turned off in customers browser
|
Re: Donate page
ok I can do the JS part, but how do I do the server side part?
|
Re: Donate page
Noob at PHP but perhaps something like this?
$var = intval($_POST['formName']); |
Re: Donate page
yeah, Im a design guy, so writing PHP to check that might be over my head. I'll check it out.
|
Re: Donate page
Stupid forum submitted my post before I wanted.
What I posted before was simply making sure it was posted as an integar. For checking which was submitted you could do maybe something like this: Code:
$var = intval($_POST['formName']); Again, I'm a noob at php and may be insecure or used too much logic/faulty logic. |
Re: Donate page
Yes you need to do that in the php file responsible for processing the form. Something like
var1 -dropdown var2 - text field P.S. same happened to me - forum submitted before I finished PHP Code:
|
All times are GMT -8. The time now is 01:31 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.