Discussions

 View Only
  • 1.  Open new window to edit a record

    Posted 11-11-2020 11:38
    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
    ------------------------------


  • 2.  RE: Open new window to edit a record

    Posted 11-11-2020 12:00
    Edited by Blake Harrison 11-11-2020 12:00
    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/
    ------------------------------



  • 3.  RE: Open new window to edit a record

    Posted 11-11-2020 12:03
    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
    ------------------------------



  • 4.  RE: Open new window to edit a record

    Posted 11-11-2020 12:31
    This should work:

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

    ------------------------------
    Ahuva Brown
    ------------------------------



  • 5.  RE: Open new window to edit a record

    Posted 11-11-2020 12:36
    Thanks all!  Ahuva's solution worked perfectly.

    ------------------------------
    Shawn Akins
    ------------------------------