Fuego
03-30-2004, 01:56 PM
Trying to get a dot between every letter from a string (thats filled at a form at the Firstname field). So When I fill out AMA it should become A.M.A. well thats fixed withthe script right under here.
But when the user fills the form with the dots already in it like A.M.A.
the scripts makes A...M...A. of it. Can find whats wrong with the script
function Send(step) {
var step = step;
var aantal_pers = 0;
var intAantalPers = parseInt(document.formulier.aantalpax.value) + parseInt(document.formulier.aantalbby.value);
var strBezetting = "";
document.formulier.antverkmr.value = <%=intKmr%>;
if (controleer_formulier()) {
for (var i = 1; i <= intAantalPers; i++) {
var VoorlLength = 0;
var strVoorlres = '';
VoorlLength = eval("document.formulier.dlnvorltri" + i + ".value.length");
for (j = 1; j <= VoorlLength; j++) {
if (eval("document.formulier.dlnvorltr" + i + ".value.substring(" + (j-1) + "," + j + ")") != ".") {
strVoorlres = strVoorlres + (eval("document.formulier.dlnvorltri" + i + ".value.substring(" + (j-1) + "," + j + ")") + '.');
}
}
But when the user fills the form with the dots already in it like A.M.A.
the scripts makes A...M...A. of it. Can find whats wrong with the script
function Send(step) {
var step = step;
var aantal_pers = 0;
var intAantalPers = parseInt(document.formulier.aantalpax.value) + parseInt(document.formulier.aantalbby.value);
var strBezetting = "";
document.formulier.antverkmr.value = <%=intKmr%>;
if (controleer_formulier()) {
for (var i = 1; i <= intAantalPers; i++) {
var VoorlLength = 0;
var strVoorlres = '';
VoorlLength = eval("document.formulier.dlnvorltri" + i + ".value.length");
for (j = 1; j <= VoorlLength; j++) {
if (eval("document.formulier.dlnvorltr" + i + ".value.substring(" + (j-1) + "," + j + ")") != ".") {
strVoorlres = strVoorlres + (eval("document.formulier.dlnvorltri" + i + ".value.substring(" + (j-1) + "," + j + ")") + '.');
}
}