movingelite Posted February 4, 2011 Share Posted February 4, 2011 Good Morning, We recently had a Joomla based component designed for our company and we're having a validation issue. Our programmer is on vacation for a week so we're seeking some assistance adjusting the rule. The field is a numeric entry called "Minimum Hours" and should receive a user input of 1, 2, 3 or 4. The problem is that 0 is allowed but shouldn't be. I pulled the snipet below from the component php file which I believe likely contains the verification rule. The problem is that I don't know php or how to adjust the rule. I'm sure I could try a few common sense approaches but I'd prefer not to screw up the application Any input would greatly be appreciated! if(isNaN($('#minimum_hours_charge').val()) || $.trim($('#minimum_hours_charge').val()).length==0 || parseInt($('#minimum_hours_charge').val())<0) { $('#minimum_hours_charge').get(0).focus(); return false; } Quote Link to comment Share on other sites More sharing options...
JAY6390 Posted February 4, 2011 Share Posted February 4, 2011 That's javascript not PHP The likely change you will need to make is to change parseInt($('#minimum_hours_charge').val())<0 so that 0 is 1 Quote Link to comment Share on other sites More sharing options...
movingelite Posted February 4, 2011 Author Share Posted February 4, 2011 Hi Jay, Sorry, I guess I really showed how little I know! I appreciate the info, that did work. That was also my common sense guess but as I mentioned I didn't want to mess anything up. I appreciate it! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.