Forum Discussion

ShawnAkins's avatar
ShawnAkins
Qrew Member
4 years ago

Open new window to edit a record

I'm trying to create a button to edit a record from a table view using a Formula-rich text field.  In the field, I have the following but it's not working?
var text Words = "Edit";
var text URL =URLRoot() & "db/" & Dbid() & "?a=er&rid=" & ToText([Record ID#]);
"<a class='Vibrant Success' onclick=\"var a=window.open(URL,'newwindow', 'width=600,height=600');\" >Words</a>"

------------------------------
Shawn
------------------------------

4 Replies

  • This should work:

    "<a class='Vibrant Success' onclick=\"var a=window.open(' " & $URL & " ', 'newwindow', 'width=600,height=600');\" >Edit</a>"

    ------------------------------
    Ahuva Brown
    ------------------------------
    • ShawnAkins's avatar
      ShawnAkins
      Qrew Member
      Thanks all!  Ahuva's solution worked perfectly.

      ------------------------------
      Shawn Akins
      ------------------------------
  • It looks like you're trying to combine pieces of HTML and JavaScript, but I think I would go with something a bit more straightforward:


    var text URL =URLRoot() & "db/" & Dbid() & "?a=er&rid=" & ToText([Record ID#]);
    "<a class='Vibrant Success' &href=" & $url &  " target='_blank'>Edit</a>"

    This will simply open the URL in a new window, though it won't limit the size of the window.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • MichaelTamoush's avatar
      MichaelTamoush
      Qrew Captain
      If you're trying to essentially make a 'pop up' window, I have never found a thread explaining this is possible...so if you figure it out post it here!

      ------------------------------
      Mike Tamoush
      ------------------------------