Forum Replies Created

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • in reply to: Save progress feature for user – front-end forms #8356
    LEO
    Participant

    Steve, I don’t have URL like http://www.domain.com/form/?form_id=56.

    I see shortcake, so user see form on page like http://www.domain.com/form

    How could user could clicks on a post to edit it ?

    Does nobody know about solution of this case?
    Maybe somebody could write very simple example, using at least 1 text field ? or step plan & guide – what to do and what to edit ?

    Or maybe I should use another framework to develop this flow ? Could you point me to resources and forums, that I should to read or study ?

    Thanks a lot, people!

    in reply to: File upload preview and Add More limit in front-end forms #8343
    LEO
    Participant

    Steve, when does it come ?

    in reply to: Save progress feature for user – front-end forms #8342
    LEO
    Participant

    What am I doing wrong ?

    By the way, I wanna develop like mentioned in this topic: https://piklist.com/support/topic/muli-page-frontend-form/

    Thanks in advance.

    in reply to: Save progress feature for user – front-end forms #8341
    LEO
    Participant

    I did this, Steve.

    Look at this, please:
    I have custom post type:

    
    post_types['my_forms'] = array(
            'labels' => piklist('post_type_labels', 'Forms')
            ,'title' => 'My Forms'
            ,'public' => true
            ,'rewrite' => array(
                    'slug' => 'my_forms'
                )
            ,'supports' => array(
                'title'
                ,'post-formats'
                )
    
            ,'capability_type' => 'post'
            ,'edit_columns' => array(
                'title' => 'Forms'
                , 'status' => 'Status'
                , 'author' => 'User'
                )
    
            ,'hide_meta_box' => array(
                'slug'
                ,'author'
                ,'revisions'
                ,'comments'
                ,'commentstatus'
                , 'wpseo_meta'
                )
    
            ,'status' => array(
    
                'new' => array(
                    'label' => 'New'
                )
                   ,'status_one' => array(
                        'label' => 'Status One'
                    )
    
                ,'accepted' => array(
                        'label' => 'Accepted'
                    )
    
                ,'declined' => array(
                        'label' => 'Declined'
                    )
                )
    
            ,'form_step' => array(
                    'step-1' => array(
                        'label' => 'Form 1'
                    ),
    
                    'step-2' => array(
                        'label' => 'Form 2'
                    )
                )
            );
    
        return $post_types;
    

    I have form code

    
    $current_user = wp_get_current_user();
    
        $args = array(
            'post_type' => 'my_forms'
            , 'author'        =>  $current_user->ID
            , 'orderby'       =>  'post_date'
            , 'order' =>  'DESC'
            ,'posts_per_page' => 1
        );
    
        $the_query = new WP_Query( $args );
    
        $post_id = '';
        while ( $the_query->have_posts() ) :
                $the_query->the_post();
                $post_id = get_the_ID();
        endwhile;
    
        echo $post_id;
    
        echo "<h4>Forms 1</h4>";
    
            piklist('field', array(
                    'type' => 'hidden'
                    ,'scope' => 'post'
                    ,'field' => 'post_type'
                    ,'value' => 'my_forms'
            ));
    
            piklist('field', array(
                    'type' => 'hidden'
                    ,'scope' => 'post'
                    ,'field' => 'post_title'
                    ,'value' => 'Form One'
            ));
    
            piklist('field', array(
                   'type' => 'hidden'
                    ,'scope' => 'post'
                    ,'field' => 'post_name'
                    ,'value' => 'form1'
            ));
    
            piklist('field', array(
                    'type' => 'hidden'
                    'scope' => 'post'
                    ,'field' => 'post_status'
                    ,'value' => 'status_one'
                    ,'attributes' => array(
                            'wrapper_class' => 'post_status'
                        ),
                'object_id' => $post_id
            ));
    
            piklist('field', array(
                    'type' => 'hidden'
                    ,'scope' => 'post_meta'
                    ,'field' => 'form_step'
                    ,'value' => 'step-1'
            ));
    
            piklist('field', array(
                    'type' => 'textarea'
                    ,'scope' => 'post_meta'
                    ,'field' => 'title-form-1'
                    ,'label' => 'Name'
                    ,'attributes' => array(
                        'placeholder' => 'Enter Name'
                        ,'rows' => 3
                        ,'cols' => 50
                        ,'class' => 'large-text',
                        'style' => 'width: 100%',
                        ),
    
                    'object_id' => $post_id
            ));
    
            piklist('field', array(
                    'type' => 'submit'
                    ,'field' => 'submit'
                    ,'value' => 'Save'
                    ,'template' => 'submit'
                    ,'attributes' => array(
                        'class' => 'button button-primary'
                    )
            ));

    1) I can’t catch: if I press button Submit, it creates new record each time. Please, provide me example of code. I don’t understand.

    2) In which section and moment I should generate unique number(for my custom field, like unique ticket number) for new record ?

    in reply to: Save progress feature for user – front-end forms #8339
    LEO
    Participant

    Steve, good afternoon!

    I have one more questions:

    1) I got the latest record for user via WP_Query, and also added ‘object_id’ => $post_id for each field in my front-end form.

    And after I press submit button for saving data (like in /forms example), it creates new record for custom type, but not edit current record. What’s wrong with this ?

    2) In which section and moment I should generate unique number(for my custom field, like unique ticket number) for new record ?

    Thanks in advance.

    Thanks.

    in reply to: Save progress feature for user – front-end forms #8338
    LEO
    Participant

    Steve, good afternoon!

    I got the latest record for user via WP_Query, and also added ‘object_id’ => $post_id for each field in my front-end form.

    And after I press submit button for saving data (like in /forms example), it creates new record for custom type, but not edit current record. What’s wrong with this ?

    Thanks.

    in reply to: Save progress feature for user – front-end forms #8323
    LEO
    Participant

    OK. And how to save fields ?

    in reply to: Save progress feature for user – front-end forms #8320
    LEO
    Participant

    Steve, i got it. Thanks.

    I did it.

    For example, I do like in demo form “new post with validation”.
    You know, when I use scope “post_meta”, and user refresh/or relogging to site, data he’ve entered didn’t showed in fields form page. How could I solve it ? What should I add to have multi-paged forms with one button submit?

    Don’t find example with save button, I see only with submit button:
    // Submit button
    piklist(‘field’, array(
    ‘type’ => ‘submit’
    ,’field’ => ‘submit’
    ,’value’ => ‘Submit’
    ));

    Also wanna to have data private, and could be seen only by author, but not other users.

    Scenario:
    Form example, we have simple front-end form (example.com/form1) with two text field. User fill up this form and click “save (for continue later)” button. And user log off. After several days user open this form, check data, edit and click “submit”. After submitted form become not editable for this user, but he could see all forms with fields, blocked for editing.

    I’m using 0.10 beta2 version

    in reply to: Save progress feature for user – front-end forms #8316
    LEO
    Participant

    Good afternoon, Steve!

    I’m glad to text you and to see your helpful feedback.

    Honestly I’m not good in php and in js, but I’m trying to code this.

    I’ve register new post_type “homework” with several statuses – draft, on pending, on remaking, accepted, declined. Have several forms with several field of different types.

    Till it works.

    My idea to have: multi-page frontend forms with save progress feature.

    Next questions is raised:
    1) if we have saved data in scope “user_meta”, how could we show this data in admin dashboard, or maybe I should use another scope ?

    2) How to save data on each form ?
    and
    3) don’t catch “Use a Piklist SUBMIT field as the button.” ?

    Could you please text very simple example code (for example, for form contained one text field) ?

    4) how could I fetch all saved & submitted data ?

    Thanks so much!

    in reply to: Front end File Uploader – Problems with Required #8309
    LEO
    Participant

    Hello!

    Please, tell me, how do you realize multi-page front end form ? With small demo and example code, please.

    Thanks so much/

    in reply to: Save progress feature for user – front-end forms #8308
    LEO
    Participant

    So, dear guys, I have implemented form wit have progress and data are saved in scope ‘user’.

    Questions:
    1) Need custom statues for record like draft, on pending, declined, and so on.

    2) I need button in form “Submit for checking”, after pressing on it, record status changed to “on pending” and block any user edit.

    3) Manu user fill up this form. And after saving first time (click button “save” on form), this recording will add to special table in admin panel (like showing posts, pages in wordpress admin) with default status “draft”.

    Thanks a lot.

Viewing 11 posts - 1 through 11 (of 11 total)