Required address fields

I am advised Knackhq does not currently offer validation on specific parts of Address Fields. Although the default Knackhq address field itself is checked "required", there is no validation that adequate amount of field lines are complete. We are aware we can use single line text for these fields and make them required, but then they are not connected with default map. Is there anyone who might be able to assist with custom JavaScript to make the City, State, and Postal Code of the default address field lines required? Thank you.

John, thanks for the super fast response. You're a hero! I think with some trial and error this will really help.

Hi Wesley

Pleased to help, I got someone to do this for me but its quite simple when you know how ;) here is mine cut and paste just alter the view and field.

Don't forget to put the address field in the same view and hide it, some CSS like this will do that:

#view_305 #kn-input-field_389
{
visibility: hidden;
height:50px;
}

============

$("#view_2994 .kn-submit").live("hover", function () {
$("#kn-input-field_389 #street").val($("#view_2994 #field_1096").val());

$("#kn-input-field_389 #street2").val($("#view_2994 #field_1097").val());

$("#kn-input-field_389 #city").val($("#view_2994_field_1460_chzn .chzn-single span").html());

$("#kn-input-field_389 #state").val($("#view_2994 #view_2994-field_1099").val());

$("#kn-input-field_389 #zip").val($("#view_2994 #field_1060").val());

});

 

Enjoy

John

John, would you happen to have the JS code to copy regular text fields into an address field? I'm interested in your workaround.

I'm interested in any suggestions about how to validate address fields, too.

As an alternative, how about using input fields (plain text, drop downs etc.), validate them,  then use JS to copy from these fields into a knack address field?  Not ideal but maybe an acceptable workaround.  Just a thought.