Hi all,
I am working on a form for users to upload data and want to fill a certain field based on the value in the field before. That is working, but rather then having to code every single possible value, I want to use an in between check. See below in bold the part I can't get to work:
function plaats_chk()
{if(document.getElementById("postcode").value=="3162PH")
{
document.getElementById("plaatsnaam").value="Rhoon"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1000-1025")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1010-1019")
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1020-1025")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1026")
{
document.getElementById("plaatsnaam").value=" Durgerdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1027")
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1028")
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1030-1099")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1030-1039")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if (parseint(document.getElementById("postcode").value.substring(0,4)) > 1040 || parseint(document.getElementById("postcode").value.substring(0,4)) < 1049)
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1050-1059")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
}
Hope you can help me out! Is in the parseint? Or just a typing error, I don't see it anymore.
Thanks!
Cynthia
I am working on a form for users to upload data and want to fill a certain field based on the value in the field before. That is working, but rather then having to code every single possible value, I want to use an in between check. See below in bold the part I can't get to work:
function plaats_chk()
{if(document.getElementById("postcode").value=="3162PH")
{
document.getElementById("plaatsnaam").value="Rhoon"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1000-1025")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1010-1019")
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1020-1025")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1026")
{
document.getElementById("plaatsnaam").value=" Durgerdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1027")
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1028")
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1030-1099")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1030-1039")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
else if (parseint(document.getElementById("postcode").value.substring(0,4)) > 1040 || parseint(document.getElementById("postcode").value.substring(0,4)) < 1049)
{
document.getElementById("plaatsnaam").value="Amsterdam"
}
else if(document.getElementById("postcode").value.substring(0,4)=="1050-1059")
{
document.getElementById("plaatsnaam").value=" Amsterdam"
}
}
Hope you can help me out! Is in the parseint? Or just a typing error, I don't see it anymore.
Thanks!
Cynthia