Forum Replies Created
-
AuthorPosts
-
LEOParticipantSteve, 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!
August 1, 2017 at 10:46 am in reply to: File upload preview and Add More limit in front-end forms #8343
LEOParticipantSteve, when does it come ?
LEOParticipantWhat 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.
LEOParticipantI 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 ?
LEOParticipantSteve, 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.
LEOParticipantSteve, 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.
LEOParticipantOK. And how to save fields ?
LEOParticipantSteve, 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
LEOParticipantGood 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!
LEOParticipantHello!
Please, tell me, how do you realize multi-page front end form ? With small demo and example code, please.
Thanks so much/
LEOParticipantSo, 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.
-
AuthorPosts