Forum Discussion

ChrisFaye1's avatar
ChrisFaye1
Qrew Cadet
5 years ago

Rich Text Button Question

Hi!

I hope everyone's staying healthy out there!

I'm using a rich text button on one of my forms. This button is being used to copy information on the record from look-up fields to editable fields.  

Everything's working well except for getting hung up on any text fields. The url seems to be stopping or breaking at the space in between the person's (data's) first and last name. 

javascript:$.get('https://****/db/****act=API_EditRecord&rid=5537&_fid_1727=1000&_fid_1728=2&_fid_1749=23&_fid_1750=24&_fid_1751=25&_fid_1752=26&_fid_1796=Corynn

Field: 1796 is a text field and the field with the source info is a look-up field of a multiple-choice field in another table. 

Text fields seem to be the only one giving me trouble. 

I've tried both using and not using ToText() around the source field with no luck. 
& "&_fid_1796=" & ToText([Property - Assistant Leasing Manager])


------------------------------
Chris
------------------------------
  • Try wrapping it in a URLEncode().

    ------------------------------
    Adam Keever
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      Adam is correct

      URLEncode([Property - Assistant Leasing Manager])

      you are making a URL just like any URL in the internet.

      if you may have noticed any URL you have ever seen do not have spaces in them and also there are certain characters that cause them to choke.  The URLEncode fixes that.

      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      mark.shnier@gmail.com
      ------------------------------
      • ChrisFaye1's avatar
        ChrisFaye1
        Qrew Cadet
        Thank You, Adam and Mark! 

        Makes sense, figured the full code would've handled it, but 100% makes sense now.

        Seeing it in use now with user fields. <face in palm>

        Thanks Again!

        ------------------------------
        Chris
        ------------------------------