Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Additional Validation to Address Book / Registration Fields


sydjeii

Recommended Posts

Hello there.

 

I want to add some additional form validation to the input fields. I want the system to check if the post code matches the city..i made a new database table for the city and output it into a dropdown list..and also i want to validate if the city chosen belongs to the chosen state.. I want to do this because some customers may play around the system and enter false information combination.

 

In summary, these are the fields that I want to validate:

 

-state (dropdown)

-city (dropdown)

-post code (textfield)

 

so the structure will look like this:

 

if(state == "South Cotabato"){
if(city=="Koronadal City" && postcode=="9506"){
valid
}
else if(city=="Tupi" && post==9505){
valid
}
else{
invalid return an error message; //any other combination will be invalid
}
}//closes the outer if statement
else if(state == "Sultan Kudarat"){
some if statements again
}

 

I think this validation maybe added to form_check.js.php file.. Just not sure. Please guide me on how to do this.

 

Thanks in advance,

 

CJ

-=PINOY AKO=-

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...