Skip to main content
Question

Javascript popup in new supported way

  • January 3, 2023
  • 0 replies
  • 71 views

Forum|alt.badge.img+11
I have a field that has javascript embedded in it to provide a confirmation to the user when they acknowledge via a button.  The code is at the end of this post.

How do I do this in the new approved javascript format?  I guess I need a code page but I basically searched the internet to get this to work, I am not really familiar with javascript.  I dont know how to call a code page or if I just simple move this javascript into it and make it a js file?

var text URL = URLRoot() & "db/" & [_DBID_THE_ELITE_WAY_VIEWS] &
"?a=API_AddRecord" &
"&_fid_6=" & URLEncode ([Record ID#]) &
"&apptoken=HIDDENFORSECURITY" &
"&_fid_8=" & URLEncode(User()) &
"&_fid_10=" & URLEncode(Today());

"javascript:" &"$.get('" & $URL & "',function(){" &"location.reload(true);" &"});" & "void(0);alert('Confirmed');"

------------------------------
Ivan Weiss
------------------------------

MarkShnierYou
Forum|alt.badge.img+24
If you are just looking to execute a URL and refresh the page, this here is sample syntax.  But it will not do a pop up.

var text Approve = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & ToText([Record ID#])
& "&_fid_144=Approved";

var text RefreshPage = URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

 
$Approve
& "&rdr=" & URLEncode($RefreshPage)

------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------