Forum Discussion
Laura_Thacker
9 years agoQrew Captain
Generally, to use color-buttons I use a button for "View" mode (reports and view-form layouts) and a separate one for Edit. The color choice of the button would be Success (green), Danger (red) and Primary (blue).
For Edit-Mode
"<a class='Vibrant Success' title='Start' href='#' style='text-align:center; display:block' onclick=\"" & "javascript:$(function(){window.location.href='" &
URLRoot() & "db/" & [_DBID_TABLE_ALIAS] & "?act=API_EditRecord&apptoken=xxxxxxxxxx&rid=" & URLEncode([Record ID#])
& "&_fid_6=" & URLEncode("Text")
& "&_fid_8=" & URLEncode(User())
& "&_fid_7=" & URLEncode(Now())
& "&rdr=' + escape(window.location); return false;});"
&"\">Button Label Here</a>"
For View-Mode/Reports
"<a class='Vibrant Success' title='Start' style='text-align:center; text-decoration:none' href='javascript:void(window.location.href = \"" &
URLRoot() & "db/" & [_DBID_TABLE_ALIAS] & "?act=API_EditRecord&apptoken=xxxxxx&rid=" & URLEncode([Record ID#])
& "&_fid_6=" & URLEncode("Text")
& "&_fid_8=" & URLEncode(User())
& "&_fid_7=" & URLEncode(Now())
& "&rdr=' + escape(window.location); return false;});"
&"\">Button Label Here</a>"
Hope this is helpful.
For Edit-Mode
"<a class='Vibrant Success' title='Start' href='#' style='text-align:center; display:block' onclick=\"" & "javascript:$(function(){window.location.href='" &
URLRoot() & "db/" & [_DBID_TABLE_ALIAS] & "?act=API_EditRecord&apptoken=xxxxxxxxxx&rid=" & URLEncode([Record ID#])
& "&_fid_6=" & URLEncode("Text")
& "&_fid_8=" & URLEncode(User())
& "&_fid_7=" & URLEncode(Now())
& "&rdr=' + escape(window.location); return false;});"
&"\">Button Label Here</a>"
For View-Mode/Reports
"<a class='Vibrant Success' title='Start' style='text-align:center; text-decoration:none' href='javascript:void(window.location.href = \"" &
URLRoot() & "db/" & [_DBID_TABLE_ALIAS] & "?act=API_EditRecord&apptoken=xxxxxx&rid=" & URLEncode([Record ID#])
& "&_fid_6=" & URLEncode("Text")
& "&_fid_8=" & URLEncode(User())
& "&_fid_7=" & URLEncode(Now())
& "&rdr=' + escape(window.location); return false;});"
&"\">Button Label Here</a>"
Hope this is helpful.