Identical jQuery autocomplete handlers for two form fields
You can create separate function like this:

function autoComplete($obj, $valueObj, $zipValue){
        $obj.autocomplete({
            source: function(request, response) {
                $.ajax({
                    url: "includes/state_au_ajax.php",
                    dataType: "json",
                    method: "post",
                    data: {
                        term : request.term,
                        state : $valueObj.val()
                    },
                                success: function( data ) {
                                     response( $.map( data, function( item ) {
                                        var code = item.split("|");
                                        return {
                                            label: code[0],
                                            value: code[0],
                                            data : item
                                        }
                                    }));
                                }
                });
            },
            autoFocus: true,            
            minLength: 2,
              select: function( event, ui ) {
                    var output = ui.item.data.split("|");                       
                    $zipValue.val(output[1]);
                },  
            delay: 300
          });  
    }


And then call it appropriately:

    autoComplete($("#suburb"), $("#state"), $('#zip_code'))
    autoComplete($("#p_suburb"), $("#p_state"), $('#p_zip_code'))