Forum Discussion

ChadBrandmire's avatar
ChadBrandmire
Qrew Assistant Captain
6 years ago

Get a field value for html page?

I'm trying to set the value of an input on a popup html page onload using the value in a form field. But all i'm getting is this: "[object Object]"
 


code:

<script>
var timg = window.opener.$("#_fid_43");
 $("#imgurl").val(timg);
</script> 



I've tried a few different things, but end with that same result.
fid_43 is a Formula- Rich Text field that gives the image url for a record.

Any ideas how to get that URL into that input?

8 Replies

  • Howdy Chad,

    Is this [object Object] field only used on a single record?  Or does it need to be dynamic based on a specific record?

    As of now, QB has no way of knowing what table or record it should look on for fid 43.  Permalinking is out of the question?
    • ChadBrandmire's avatar
      ChadBrandmire
      Qrew Assistant Captain
      [object Object] is not a field it is the value I'm getting for the input (on error).

      The script is running on the html page. 

      Is what you're saying that I can't use jQuery to look at the window opener?
    • ScottMarks's avatar
      ScottMarks
      Qrew Member
      Gotchya.  Take a look at my reply below-  I think it may help.  You can accomplish this with jQuery, but on a stand-alone code page, the jQuery will have no idea what #_fid_43 means, you have to provide it with an actual link, perhaps utilizing the API. 
    • ChadBrandmire's avatar
      ChadBrandmire
      Qrew Assistant Captain
      I've played around with a couple of api methods. My problem with the api is how does my html page get the rid for the query? 
  • Replying to myself here:

    You can utilize API_GetRecordInfo for this, should you have all the prerequisites.. (RecordID & DBID)

    https://<DOMAIN>.quickbase.com/db/<DBID>?a=API_GetRecordInfo&rid=<RID>&apptoken=<APPTOKEN>

    You'll then have to parse out the response for the specific _fid_ you're looking for, and you can return those results.

    Let me know if this helps at all.