Populate forms with JS

Support MB Frontend Submission Populate forms with JS

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #36261
    Nicholas CoxNicholas Cox
    Participant

    Hi

    I am populating front end forms with the shortcode and query string ?rwmb_frontend_field_post_id=277

    I was wondering is it possible to populate the form via Javascript using a similar approach as query strings in PHP?

    Thanks

    #36266
    Long NguyenLong Nguyen
    Moderator

    Hi Nick,

    I've not used the JS code to edit the form like that. But you can try to use AJAX with the function wp_remote_get() to get the form config and value then display it on your page. Please read more on this documentation https://developer.wordpress.org/reference/functions/wp_remote_get/

    #36268
    Nicholas CoxNicholas Cox
    Participant

    Ok thanks. That might work. What shall i target with wp_remote_get() ? I am not quite sure how to grab the metabox config from a post id.

    #36650
    Nicholas CoxNicholas Cox
    Participant

    Hi, Is it possible for you provide me with an example please?

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.