S
Sudhakar Doddi
Greetings,
I am a novice in Javascript and I am not able to succeed finding right
regular expression for my requirement.
Input in HTML form should be in the format of row.rack.bin i.e
three separate words separated by two dots/periods. User can enter
"xyz.." also. Minimum two dots/periods must be present. Here is my
code, it works partially. Please point me to the right expression.
<script>
locatorfmt=/[^\.]\.[^\.]\.[^\.]/i;
function validateLocator() {
locator=document.getElementById('p_item_location').value;
if (locator.search(locatorfmt)==-1) {
alert('Please enter locator in correct format');
return false;
}
return true;
}
</script>
thanks
Sudhakar
I am a novice in Javascript and I am not able to succeed finding right
regular expression for my requirement.
Input in HTML form should be in the format of row.rack.bin i.e
three separate words separated by two dots/periods. User can enter
"xyz.." also. Minimum two dots/periods must be present. Here is my
code, it works partially. Please point me to the right expression.
<script>
locatorfmt=/[^\.]\.[^\.]\.[^\.]/i;
function validateLocator() {
locator=document.getElementById('p_item_location').value;
if (locator.search(locatorfmt)==-1) {
alert('Please enter locator in correct format');
return false;
}
return true;
}
</script>
thanks
Sudhakar