Discussions

 View Only
  • 1.  field values from form

    Posted 03-12-2019 13:36
    I'm trying to get field values that I can then work with in JavaScript. Trying to do this on load of opening/viewing a specific record.


  • 2.  RE: field values from form

    Posted 03-12-2019 17:23
    What method are you trying to use to grab them? Clicking a button? Load when the form loads? If you just need it on the form as they're entering, jQuery is one option. Each field on the form is commonly has an ID associated with the field ID that you can grab. Another option is to do API_DoQuery when the form loads if you need the data when the form is loading



    Chayce Duncan | Technical Lead
    (720) 739-1406 | chayceduncan@quandarycg.com
    Quandary Knowledge Base


  • 3.  RE: field values from form

    Posted 03-12-2019 19:19
    The full case is that I have an iframe with javascript which needs information from the form. It would be grabbing the information and running when the form loads, so no button clicking.

    I'm using a rich text field to insert an iframe, which renders a custom HTML code page, which also references a JS code page.

    What is the field ID notation? I've tried _fid_3.value for example and that didn't work.


  • 4.  RE: field values from form

    Posted 03-12-2019 19:30
    If you have a code page then doing a DoQuery would be the better alternative to help build the HTML that way. 

    The field notation is related to the actual id of the elements on the form. So for example:




    the input for tdf_5 is field ID 5 in an app of mine

    $("#tdf_5").text() gets the value 'Marketing'


  • 5.  RE: field values from form

    Posted 03-13-2019 12:35
    Will that work to access the parent html since I'm dealing with an iframe?

    UPDATE: nevermind, Figured it out... looks like Quickbase has a global variable kRid, which is the record ID, and I can get it from the parent html with parent.kRid in the iframe JavaScript.

    I can use that to do the DoQuery for anything else that I need.