advanceform_ziplookup

sample

Example ZipCode : Enter ZipCode..

20008 Washington
30303  Atlanta
33130  Miami

https://code.google.com/p/ziplookup/
Caution! Google Code will close on January 25th, 2016. Therefore After January 16, 2016,  this sample does not work. please look for it, such as Github
http://google-opensource.blogspot.jp/2015/03/farewell-to-google-code.html


{{{advancedform('ziplookup');}}}
必須項目: *の欄は必須です
 
 *)reCAPTCHA( api Ver2.0) is "New Type recaptcha_xh" ・・・Now .Pull requests to cmb69 ..https://github.com/bbfriend/recaptcha_xh
#######################################
####### OPEN  advancedform/languages/[yourlang].js
### Add 
$plugin_tx['advancedform']['label_form_class']="FormTag's class";
$plugin_tx['advancedform']['label_class']="Class";
#######################################
####### OPEN  advancedform/admin.php
#### Find  (About Line310)
    $forms[$id] = array(
        'name' => '',
        'title' => '',
        'to_name' => $pcf['mail_to_name'],
        'to' => $pcf['mail_to'],
        'cc' => $pcf['mail_cc'],
        'bcc' => $pcf['mail_bcc'],
        'captcha' => (bool) $pcf['mail_captcha'],
        'store' => false,
## After Add
        'form_class' => '',
#### Find   (About Line320)
        'fields' => array(
            array(
                'field' => '',
                'label' => '',
                'type' => 'text',
                'props' => "\xC2\xA6\xC2\xA6\xC2\xA6",
## After Add
                'class' => '',
#### Find   (About Line376)
    $fields = array(
        'name', 'title', 'to_name', 'to', 'cc', 'bcc', 'captcha', 'store', 
## Add to the end
 'form_class',
#### Find  (About Line422)
    $o .= '<thead><tr>'
        . '<th>' . $ptx['label_field'] . '</th>'
        . '<th>' . $ptx['label_label'] . '</th>'
        . '<th colspan="3">' . $ptx['label_type'] . '</th>'
## After Add
        . '<th>' . $ptx['label_class'] . '</th>'
#### Find (About Line455)
        $o .= '</select></td>'
            . '<td>'
            . tag(
                'input type="hidden" class="hidden" name="advfrm-props[]"'
                . ' value="' . Advancedform_hsc($field['props']) . '"'
            )
            . '<td><a>' . Advancedform_toolIcon('props') . '</a>' . PHP_EOL;
        $checked = $field['required'] ? ' checked="checked"' : '';
## After Add
// Add Class
        $o .= '<td>'
            . tag(
                'input type="text"  size="10" name="advfrm-class[]"'
                . ' value="' . Advancedform_hsc($field['class']) . '"'
            )
            . '</td>' . PHP_EOL;
#######################################
####### OPEN  advancedform/advfrm.php
#### Find (About Line 800 ,in function Advancedform_displayField())
    $o = '';
    $name = 'advfrm-' . $field['field'];
    $id = 'advfrm-' . $form_id . '-' . $field['field'];
    $props = explode("\xC2\xA6", $field['props']);
    $is_select = Advancedform_isSelect($field);
    $is_real_select = Advancedform_isRealSelect($field);
    $is_multi = Advancedform_isMulti($field);
## After Add
// Add Class
    if(isset($field['class']) && !empty($field['class'])){
		$class = ' class="'. $field['class'] .'"';
	}else{
		$class = '';
	}
#### Find (About Line 815
            $o .= '<select id="' . $id . '" name="' . $name . $brackets . '"'
                . $size . $multi .'>';
#### Replace With 
            $o .= '<select id="' . $id . '" name="' . $name . $brackets . '"'
                . $size . $multi .$class .'>';
#### Find (About Line 853
                        . $sel
#### Replace With 
                        . $sel . $class
#### Find (About Line 880
                . '" rows="' . $rows . '">'
#### Replace With 
                . '" rows="' . $rows . '"' . $class .'>'
#### Find (About Line 930
                . '"' . $value . $accept . $size . $maxlen
#### Replace With 
                . '"' . $value . $accept . $size . $maxlen . $class
#### Find (About Line 1050 ,in function Advancedform_formView())
    $forms = Advancedform_db();
    $form = $forms[$id];
    Advancedform_initJQuery();
## After Add
// Add Class
    if(isset($form['form_class']) && !empty($form['form_class'])){
		$class = ' class="'. $form['form_class'] .'"';
	}else{
		$class = '';
	}
#### Find (About Line 1060 ,in function Advancedform_formView())
    $o .= '<div class="advfrm-mailform">' . PHP_EOL
        . '<form name="' . $id . '" action="' . $sn . '?' . $su . '" method="post"'
        . ' enctype="multipart/form-data" accept-charset="UTF-8">' . PHP_EOL
#### Replace With 
    $o .= '<div class="advfrm-mailform">' . PHP_EOL
        . '<form name="' . $id . '" action="' . $sn . '?' . $su . '" method="post"'
//        . ' enctype="multipart/form-data" accept-charset="UTF-8">' . PHP_EOL
        . ' enctype="multipart/form-data" accept-charset="UTF-8"'.$class .'>' . PHP_EOL

And.

Define them in a file FORM_NAME.inc(.php) in Advancedform_XH's data folder

<?php
function advfrm_custom_field_default($form_name, $field_name, $opt, $is_resent){
	global $hjs;
 if($field_name == "Zipcode"){ //Zipcode is field_name
	$hjs .= '<script src="http://ziplookup.googlecode.com/git/zip-lookup/zip-lookup.min.js" type="text/javascript" ></script>'."\n";
 }
}
?>

 

 

 

 

http://cmsimpleforum.com/viewtopic.php?f=12&t=3451