field values from form

  • 0
  • 1
  • Question
  • Updated 3 months ago
  • In Progress
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.
Photo of Ryan Stanford

Ryan Stanford

  • 1,408 Points 1k badge 2x thumb

Posted 3 months ago

  • 0
  • 1
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
Photo of Ryan Stanford

Ryan Stanford

  • 1,408 Points 1k badge 2x thumb
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.
(Edited)
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'
Photo of Ryan Stanford

Ryan Stanford

  • 1,408 Points 1k badge 2x thumb
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.
(Edited)