Pass field value to html field

Home Forums Quform WordPress Pass field value to html field

This topic is: resolved
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35168
    oivanr
    Participant

    HI,

    I have a form, inside the form a text field: $(‘.quform-field-7_3’). Also I have a radio button field: $(‘.quform-field-7_25’) and a html field: $(‘.quform-field-7_26’).

    Inside the html field I have a button : <button class=”btn-default” type=”button” id=”informeGrado”>Crear informe</button> also I had created a <p>Grado a buscar: <span id=”grado”></span></p>, following a tutorial you had at the forums.

    The radiobutton ask if the user wants to create a report. When the user say ‘yes’, through a logical condition the html field is visible.

    When the hmtl field is visible the user can click on the “InformeGrado” button, if the user does it, I call function in a js library who call an ajax:

    $(‘#informeGrado’).click(function(){
    accion = ‘informeGrado_Ajax’;
    tabla = ‘wp_vw_04_19’;
    buscar = $(‘#grado¡’).text(); <- this show the value at the html field, but I can’t use it to make an ajax call
    console.log(buscar); <- buscar don´t have any value

    jQuery.ajax({ …

    If the text field $(‘.quform-field-7_3’) is empty the report prints all the records of a mysql table, that is fine.
    What I want is to get the value of the text field $(‘.quform-field-7_3’) and send through ajax to print only the row that match this value.

    I already had done this, but it didn`t work.
    var grado = $(‘.quform-field-7_3’).val(grado);
    $(‘#grado’).text(grado);

    The problem is that I don’t know how to get the value of $(‘.quform-field-7_3’) and use it to send through ajax. Remember that the ajax call is inside a html field and a function of js

    Can you help me please?

    #35171
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #35173
    oivanr
    Participant

    Hi,
    It works fine.
    Thanks.

    #35221
    oivanr
    Participant

    HI,
    How I can do to acces to HTML field which is located in a second page of my form.
    For example I have a form who has page 1 and page 2. In the page 2 I have an html with a
    <span id=”nombre”>.
    In my first page I have a dropdown (13_21) I have done this:
    $(‘#nombre’).text($(‘.quform-field-13_21 option:selected’).text());
    It doesn’t work.
    Thanks in advance for your help.

    #35222
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #35223
    oivanr
    Participant

    Hi,
    I check the other html fields and it is correct. There is another field with the same name. I already change the name and it works properly.
    Thanks a lot.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy