function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RbnRbn 

Help:in Javascript Button

I have a standard button which is already designed by making use of javascript.

 

Right now when i click on the button its getting opened in the Same page.

 

My req is that when i click on the   button it should redirect to the new tab.

 

Please help me how can i get the id of the button so that i can proceed further.

 

Thanks in Advance.

smohyeesmohyee

If I understand you correctly, you want the javascript in the button to open the page in a new tab, as opposed to in the same window as the page the button was in?

 

If so, a quick google for "javascript open new window"  and a browse through the first couple links taught me that you as a JS coder cannot control whether content opens in a new tab or a new window (its set by end user browser preferences). 

 

However, go here: http://www.w3schools.com/jsref/met_win_open.asp

 

 

Dev_RDev_R

Just use :

 

function new_tab(){

         window.open('url');   //specify the url .

}

 

Call this function in your button onclick event . It will work.