I want the user to click a link and then that link should open in a modal window. I have tried this on a blank page with a CEWP and it works using both of the following codes:

<a onclick="NewItem2(event, this.href); return false; width=1000; height=800;" href="linkURL/">Link Text</a> 

<a href="javascript:OpenPopUpPage('linkURL');">LinkText</a>

They both work BUT i need this to work inside of a custom list.

i have a custom list with a Hyperlink column but when I try to insert either of the href codes above, it tells me it is invalid.

How can i get my full URL to show and work?

Any help would be great!

1 Answer 1


You should be able to achieve this using a calculated field. You can build your code into the calculated field. One thing to do though is make sure you set the calculated field to numeric and not text. It needs the numeric setting to render properly.

You can find an example similar to your situation here: https://sharepoint2020.wordpress.com/2013/02/20/using-javascript-url-in-calculated-columns/

It's a bit different, but the concept is pretty close.

Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.