MyBB Community Forums

Full Version: need simple php help in this code please
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a page to deposit moneys via LR, and I want to put minimum deposit 5$, how can i set minimum payment? please help.
This can be done using a simple javascript code;
Add the following code in <head> tag;
<script type="text/javascript">
	function validate_form()
	{
		allowed = true;
		if(document.deposit_form.amount.value < 5)
		{
			alert("The minimum amount required is 5$ USD. Please go back and try again!");
			allowed = false;
		}
			return allowed;
	}
</script>
Now in form's tag add the following line;
name="deposit_form" onsubmit="return validate_form();"

Make sure that the amount input box have the same amount "name" field, since it has been used in the amount's value in above code.
^That'll get the job done, but using on* attributes is definitely primitive, and users can get around the limit just by disabling JS.
(2012-12-13, 04:00 PM)CAwesome Wrote: [ -> ]^That'll get the job done, but using on* attributes is definitely primitive, and users can get around the limit just by disabling JS.

Really doesnt matter, but I still couldnt integrate this I contacted Yaldaram I sent him full source code of the page hope he can integrate it for me.

Didint get reply yet, any one please?