Floodster
Technical User
- Jan 28, 2005
- 204
Hi,
I have some JAVASCRIPT which I have had help with from this forum which ensures that an entry has been entered into a postcode search. What I need now is the code slightly amending so that the user has to enter at least 3 characters before it will submit (i.e B68 or DY3), this will ensure that if the user just enters B they won't get 000's of results. I'm not very good with JAVASCRIPT so I've not got a clue where to start. The current code is;
Thanks.
I have some JAVASCRIPT which I have had help with from this forum which ensures that an entry has been entered into a postcode search. What I need now is the code slightly amending so that the user has to enter at least 3 characters before it will submit (i.e B68 or DY3), this will ensure that if the user just enters B they won't get 000's of results. I'm not very good with JAVASCRIPT so I've not got a clue where to start. The current code is;
Code:
function validate_postcode(field,alerttxt)
{
with (field)
{
if (value=="")
{alert(alerttxt);return false}
else {return true}
}
}
function validate_form3(postcode_search)
{
with (postcode_search)
{
if (validate_postcode(postid,"Enter Postcode")==false)
{postid.focus();return false}
}
}
Thanks.