Title: Cannot update an input text field value with php
Last modified: March 3, 2024

---

# Cannot update an input text field value with php

 *  Resolved [mitys](https://wordpress.org/support/users/mitys/)
 * (@mitys)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/)
 * Hello, I am trying to populate my update form fields from a custom post type 
   data.
 * Bases on the plugin docuention, I used the Forminator_API::update_form_field(
   $form_id, $field_id, $data ); method like this:
 * $data =array(
 *     ```wp-block-code
           'options' => Array
               (
                   'label' => 'Prenom',
                   'value' => 'this is the last name'
               ),
   
   
                   'name' => 'text-1',
                   'value' => 'this is the last name'
               );
       ```
   
 * $fields = Forminator_API::update_form_field( 16049, ’email-1′, $data );
 * And it did not work. This code only works for the email input type and the phone
   input.
 * Any help please ?
 * Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcannot-update-an-input-text-field-value-with-php%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17470426)
 * Hello [@mitys](https://wordpress.org/support/users/mitys/) ,
 * Can you share the whole code snippet so our developers can take a look and see
   what they can advise?
    Please use pastebin.com or a Dropbox like service to share
   code with us.
 * kind regards,
    Kasia
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17472129)
 * Hello [@mitys](https://wordpress.org/support/users/mitys/) ,
 * Please check this:
 *     ```
       $form_id = 1609;
           $field_id = 'text-1';
   
           $data = array(
       		'id' => 'text-1',
       		'element_id' => 'text-1',
       		'condition_action' => 'show',
       		'condition_rule' => 'any',
       		'conditions' => Array
       			(
       			),
   
       		'type' => 'email',
       		'options' => Array
       			(
       			),
   
       		'cols' => '12',
       		'validation' => '',
       		'placeholder' => 'Testing',
       		'field_label' => 'Enter Text',
       		'description' => '',
       		'validation_text' => '',
       		'custom-class' => '',
               'default' => 'testings'
       	);
   
       	$fields = Forminator_API::update_form_field( $form_id, $field_id, $data );
       ```
   
 * **‘default’ => ‘testings’** – default key is where you put custom value.
 * kind regards,
    Kasia
 *  Thread Starter [mitys](https://wordpress.org/support/users/mitys/)
 * (@mitys)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17472590)
 * Hello, thank you, the default key worked well for the text input type.
 * I would like to do the same thing for the name input and the select input, how
   could I achieve that ?
 * Thank you.
 *  Thread Starter [mitys](https://wordpress.org/support/users/mitys/)
 * (@mitys)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17473669)
 * And for the address input too, thank you !
 *  [Kris – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport13/)
 * (@wpmudevsupport13)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17475369)
 * Hi [@mitys](https://wordpress.org/support/users/mitys/)
 * I pinged our SLS Team to review this and update the code. We will post an update
   here as soon as more information is available.
 * Kind Regards,
   Kris
 *  Thread Starter [mitys](https://wordpress.org/support/users/mitys/)
 * (@mitys)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17477038)
 * Hi, ok thank you,
 * I will wait for that.
 *  Thread Starter [mitys](https://wordpress.org/support/users/mitys/)
 * (@mitys)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17493967)
 * Hello, I cannot see the updates on the plugin documentation. Did you add any 
   code ?
 *  Plugin Support [Nithin – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport11/)
 * (@wpmudevsupport11)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17500207)
 * Hi [@mitys](https://wordpress.org/support/users/mitys/),
 * We would like to have a bit more information regarding the workflow you are looking
   to achieve.
 * > I would like to do the same thing for the name input and the select input, 
   > how could I achieve that ?
 * If you are looking to display the default value on the front end, we would suggest
   achieving this through jQuery instead of modifying each field with the Forminator
   API.
 * Could we know whether using jQuery would fit your requirements or not? So that
   we could suggest based on that?
 * > Hello, I cannot see the updates on the plugin documentation. Did you add any
   > code ?
 * Not sure I fully understood what you meant above. We can only provide and suggest
   code in this forums. Could you please explain further what you are referring?
 * Looking forward to your response.
 * Best Regards,
 * Nithin
 *  Thread Starter [mitys](https://wordpress.org/support/users/mitys/)
 * (@mitys)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17500490)
 * Hi,
 * Actually I succeded to populate the text input(default) and also the select input(
   placeholder). What I am trying to do is to populate the form fields based on 
   acf values before modifying them with the form.
 * The only problem that persists now is the postdata title that I couldn’t display
   on the form with the update_form_field function..
 *  Plugin Support [Williams – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport3/)
 * (@wpmudevsupport3)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17506556)
 * Hi [@mitys](https://wordpress.org/support/users/mitys/),
 * Hope this message finds you well.
 * > The only problem that persists now is the postdata title that I couldn’t display
   > on the form with the update_form_field function.
 * That method is to update the field, as explained by Nithin, if you are trying
   to populate default values it can be done using jQuery instead of updating the
   post.
 * However, if the post title is not populating, could you check if the meta value
   us correct?
 * Best regards,
    Laura
 *  Plugin Support [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * (@wpmudev-support8)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17526072)
 * Hi [@mitys](https://wordpress.org/support/users/mitys/)
 * We didn’t hear back from you for quite some time already so I’m marking this 
   topic as resolved.
 * If you still need assistance with this, just let us know.
 * Kind regards,
    Adam

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

The topic ‘Cannot update an input text field value with php’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 11 replies
 * 6 participants
 * Last reply from: [Laura – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support8/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/cannot-update-an-input-text-field-value-with-php/#post-17526072)
 * Status: resolved