Hi,
Assuming that you're already have added the function cust_trigger_plugin_hook() (for telephone), I think this would be it:
<?php
function cust_autofill_user_zip() { ?>
<script type="text/javascript">
var currentZip = '';
$("#plugin-hook").change(function() {
var zipCFInput = $("#meta_zip_code");
if (currentZip == '') {
zipCFInput.val('<?php echo osc_user_field('s_zip'); ?>');
} else {
zipCFInput.val(currentZip);
}
zipCFInput.change(function(){
currentZip = zipCFInput.val();
});
});
</script>
<?php }
$section = Rewrite::newInstance()->get_section();
if ($section == 'item_add' || $section == 'item_edit') osc_add_hook('footer', 'cust_autofill_user_zip');
?>
Regards
Thank you so much!
Help please translate zip code into upper case.
I can not:(
Here is my code:
function cust_autofill_user_zip() { ?>
<script type="text/javascript">
var currentZip = '';
$("#plugin-hook").change(function() {
var zipCFInput = $("#meta_zip_codes").mask("***?* ***");
$("#meta_zip_codes").val($("#meta_zip_codes").val().toUpperCase());
if (currentZip == '') {
zipCFInput.val('<?php echo osc_user_field('s_zip'); ?>');
} else {
zipCFInput.val(currentZip);
}
zipCFInput.change(function(){
currentZip = zipCFInput.val();
});
});
</script>
<?php }
$section = Rewrite::newInstance()->get_section();
if ($section == 'item_add' || $section == 'item_edit') osc_add_hook('footer', 'cust_autofill_user_zip');
It is necessary that for unauthorized users the zip code is transferred to the upper case