Advancedform_XH

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

cmb
Posts: 11576
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Advancedform_XH

Postby cmb » Wed Feb 12, 2014 7:51 pm

Hello Community,

I have just released Advancedform_XH 1.0rc4.

I have fixed some issues regarding mails that were reported as being sent, but actually weren't. Thanks to ubresien for reporting these issues and helping to fix them.

Enjoy,
Christoph
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

bca
Posts: 268
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Postby bca » Thu Feb 13, 2014 12:28 pm

Not sure what's happening but getting
NOTICE: Undefined index: fields
/www/sites/xxx/xxx/www.xxx.co.uk/web/cms162/plugins/advancedform/advfrm.php:904
WARNING: Invalid argument supplied for foreach()
/www/sites/xxx/xxx/www.xxx.co.uk/web/cms162/plugins/advancedform/advfrm.php:904

Tried changing supplied templates but after form is displayed once on the page it either disappears from the mailforms list in the backend or the form shows on the page with all the fields gone, except the submit and reset button

When going back to the form in the form list i get

NameLabelTypeReq.

where the fields should be

I hope its not me!

B

cmb
Posts: 11576
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Advancedform_XH

Postby cmb » Thu Feb 13, 2014 12:52 pm

Um, that sounds like forms.dat is corrupted. Can you send me the file by mail? (it does contain the definition of the forms only, no information about sent emails)
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

cmb
Posts: 11576
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Advancedform_XH

Postby cmb » Thu Feb 13, 2014 9:50 pm

Hello Community,

I have just released Advancedform_XH 1.0rc5.

The issues reported by bca above turned out to be caused by a bug, where it was possible to purge a form definition by simply requesting the URL in the address line after saving the form. This bug, and potentially similar ones are now fixed. Thanks, B.

Enjoy,
Christoph
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

bca
Posts: 268
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Postby bca » Mon Feb 17, 2014 5:15 pm

Hi Christoph
I am desiging a custom form but having problems with spacing.

Where does the <pre< tag in

Code: Select all

<h1>testadv form</h1>
<pre><span><div class="advfrm-mailform">


come from?

B

cmb
Posts: 11576
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Advancedform_XH

Postby cmb » Mon Feb 17, 2014 5:57 pm

bca wrote:Where does the <pre< tag in
[...]
come from?

I assume it comes from the editor. Usually it should be a <div> or a <p> (whereby the latter will be automatically replaced with <div> in latest versions of CMSimple_XH). Most likely the <span> also comes from the editor; might be a relict of some inline formatting (e.g. color).
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

bca
Posts: 268
Joined: Tue Sep 15, 2009 4:49 pm

Re: Advancedform_XH

Postby bca » Mon Feb 17, 2014 6:34 pm

Ha! You are right. Tinymce is putting it in. It is wrapping the plugin call in <pre><span>

Fixed it by inserting the plugin call into a <div>.

I should have posted this morning. Would have saved lots of time. :lol:

Thanks Christoph

B

cmb
Posts: 11576
Joined: Tue Jun 21, 2011 11:04 am
Location: Mü-Sa, RLP, DE
Contact:

Re: Advancedform_XH

Postby cmb » Sun May 25, 2014 5:30 pm

Hello Community,

I have just released Advancedform_XH 1.0.

This release fixes issues with regard to the CSV files which could not reliably deal with textarea fields. See the new config option csv_separator. Thanks to oldnema for reporting this issue.

Enjoy,
Christoph
Christoph M. Becker –Plugins for CMSimple_XH, but not for CMSimple 4+

utaka
Posts: 50
Joined: Fri Sep 18, 2015 6:00 am
Location: japanese
Contact:

Add Class field for "zip-code look-up"

Postby utaka » Mon Dec 21, 2015 3:03 am

I worked zip-lookup ,ajaxzip3(yubinbango) by Advancedform_XH
zip-lookup is a lightweight JSON based (no database) look-up script that uses a pre-configured list of json files to perform a zip-code look-up on (nearly) all available zip-codes. Simply add this library anywhere you have an address form in your websites and make your client's lives a little easier!


sample demo(used "code.google.com/p/ziplookup/") : http://cmsimple-jp.org/xh/?test/PluginT ... _ziplookup

I have to add the class field.
Image

Code: Select all

#####
# Add Class field for "zip-code look-up"

#######################################
####### 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
Example : if you is to use the "http://clevertree.github.io/zip-lookup/zip-lookup.min.js" *2017/08

Code: Select all

<?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://clevertree.github.io/zip-lookup/zip-lookup.min.js" type="text/javascript" ></script>'."\n";
 }

}

?>


ziplookup : https://github.com/clevertree/zip-lookup
ajaxzip3(japanese):https://github.com/ajaxzip3/ajaxzip3.github.io
yubinbango(japanese):https://github.com/yubinbango/yubinbango
Last edited by utaka on Wed Aug 30, 2017 10:29 pm, edited 3 times in total.
******************************************************
Japan Site http://cmsimple-jp.org
Twitter Googe+ github
*I English is not a good . I'm sorry...
*Ich habe nicht eine gut Deutsch. Es tut mir leid ...
*Jeg kender ikke dansk
--Powered by Google Translate-----

kurtm
Posts: 36
Joined: Tue Sep 03, 2013 12:29 am
Location: New Zealand

Re: Advancedform_XH

Postby kurtm » Fri Jul 15, 2016 6:35 am

Christoph,

I installed 'Advancedform_XH' and built a custom mail form which has several checkboxes. When the mail is sent the information from the mail form appears on both the email and returned the web form. However, there is no indication of what checkboxes were ticked. None of the checkbox lables indicate that any of the boxes were checked or unclecked. All the boxes appear on the list.

There is no other customisation.

What am I missing?

Kurt


Return to “Addons and Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest