Required address fields

Comments

5 comments

  • Avatar
    Johny B Good

    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.

  • Avatar
    Michael Fox

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

  • Avatar
    Wesley Trimble

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

  • Avatar
    Johny B Good

    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

  • Avatar
    Wesley Trimble

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

Please sign in to leave a comment.