how to stop a form submitting when you press enter php how to stop a form submitting when you press enter php
You've created a lovely form but whenever someone presses enter your form submits when you don't want it to you just want it to move to the next field or even stay on that field.
I searched for an answer to this on line but didn't come up with one. All php checks ie isset form submit or submit =1 etc etc all never worked until i added another submit button.
Then it became simple case of if ($_POST['submit']=='SUBMIT') {
Your code goes here
}
If you only want one button then you need to hide the other button. Alas using visibility doesn't work as this ignores that there is another button there and creates the same problem.
So i created a button that had the same background and border color as my page background. and width=1 this will make a small button that won't be seen and solves the problem of hitting the enter button.
Trending right now
The Hidden Question That Tricks Your Brain Into Attracting Massive Wealth Effortlessly The Hidden Question That Tricks Your Brain Into Attracting Massive Wealth Effortlessly The only cough remedy that really works The Hidden Truth That Ends All Loneliness Forever Why We Cling to Our Struggles Simple easy way to get out of jury service with no hassle. What have we learnt about humanity since covid appeared. Why Letting Go is the Key to Scaling Your Business Free packing packaging. Do you want to get free or low cost packing easily The Unpermitted Power of a Free Mind How to identify hot selling products on Ebay How to reject an invoice for council tax or any other invoice Why do people actually sell on ebay Read Yourself Slim Ebook Are cows really responsible for global warming How to stop coughing quickly and easily Are you a commercial electrical company How to get facebook to refresh my og image Contrails or chemtrails How Niching Down Your Product Can Skyrocket Your Profits Natural Remedies and Dietary Approach for Psoriasis How to stop a form submitting when you press enter php
|