yogibear Posted September 21, 2008 Share Posted September 21, 2008 Hi Is there any way of adding validation to the post code field to accept the post code only if it contains a space. Even better, automatically add a space. Best wishes Yogi bear 0 Quote Link to comment Share on other sites More sharing options...
yogibear Posted September 22, 2008 Author Share Posted September 22, 2008 No one know if its even possible? 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted September 22, 2008 Share Posted September 22, 2008 Everything is possible Just add some javascript to the onsubmit ... 0 Quote Link to comment Share on other sites More sharing options...
yogibear Posted September 22, 2008 Author Share Posted September 22, 2008 Everything is possible Just add some javascript to the onsubmit ... Hi Thanks for your reply Please can you tell me which page (file name?) I should add the JavaScript, I am unable to find it. Best wishes yogi 0 Quote Link to comment Share on other sites More sharing options...
magga Posted September 22, 2008 Share Posted September 22, 2008 viewcart.tpl assuming your using the cart? 0 Quote Link to comment Share on other sites More sharing options...
ilihost Posted September 23, 2008 Share Posted September 23, 2008 Smart, Othellotech. I think this is a very interesting topic for much people. If any of you find the solution it could be a good idea to share it here 0 Quote Link to comment Share on other sites More sharing options...
yogibear Posted September 26, 2008 Author Share Posted September 26, 2008 Hi all Thanks for your replies, and sorry for my slow reply. I’ve had a look but its a little out of my league. If anyone manages to do it, please can I have a copy? Adding it to the next release would be great. Best wishes Yogi 0 Quote Link to comment Share on other sites More sharing options...
yogibear Posted September 26, 2008 Author Share Posted September 26, 2008 Well, I thought it was out of my league but I managed to get an alert box to display if the post code doesn’t contain a space. This will only happen if the country is set to GB so it doesn’t affect other counties post/area codes. I am now going to try and get it to put a space in, if one hasn’t been entered. Best wishes Yogi 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted September 26, 2008 Share Posted September 26, 2008 Well, I thought it was out of my league but I managed to get an alert box to display if the post code doesn’t contain a space. This will only happen if the country is set to GB so it doesn’t affect other counties post/area codes. I am now going to try and get it to put a space in, if one hasn’t been entered. Best wishes Yogi if gb remove spaces check length >= 5 and <=8 capitalise insert space at 3 before the end so works for rm12 4pq rm1 4ax e1 7ey ec2r 8jr job done or you could use the top google result ... http://javascript.internet.com/forms/uk-postcode-validation.html 0 Quote Link to comment Share on other sites More sharing options...
harrip Posted October 4, 2008 Share Posted October 4, 2008 I agree this is a useful addition. Nominet rejct domain orders with and incorrect post code so if this could be added to a future distribution I am sure a lot of us would find it useful. 0 Quote Link to comment Share on other sites More sharing options...
Summy Posted October 5, 2008 Share Posted October 5, 2008 if gbremove spaces check length >= 5 and <=8 If your stripping spaces and checking the length then it'll be >=5 and <=7 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted October 8, 2008 Share Posted October 8, 2008 If your stripping spaces and checking the length then it'll be >=5 and <=7 my list wasnt necessarily in order 0 Quote Link to comment Share on other sites More sharing options...
xister Posted October 8, 2008 Share Posted October 8, 2008 post lenght in austria = 4 post lenght in germany = 5 So you don´t get autria customers in your system. 0 Quote Link to comment Share on other sites More sharing options...
ivaserver Posted December 3, 2008 Share Posted December 3, 2008 (edited) hi Could some give the exact code. The template name and the possition I am using the default order form template. Thanks Edited December 3, 2008 by ivaserver 0 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.