BjornSkifs Posted May 3, 2012 Report Share Posted May 3, 2012 I want to have a calculated field where the user either sees a link to click on (which redirects to a document), or sees a message "The document hasn't been uploaded yet". I tried to do this by having the following in a calculated field: CASE WHEN [@field:File]<>'' THEN [url="[@field:File]"]Click here to read the document[/url] ELSE 'The document hasn't been uploaded yet.' END But this doesn't work. When I want to go the the details page I get Error in formula. Do you have any suggestions? I can't upload the file to Caspio, so that is not an option. Thanks! Bjorn Quote Link to comment Share on other sites More sharing options...
casyana Posted May 5, 2012 Report Share Posted May 5, 2012 I want to have a calculated field where the user either sees a link to click on (which redirects to a document), or sees a message "The document hasn't been uploaded yet". I tried to do this by having the following in a calculated field: CASE WHEN [@field:File]<>'' THEN [url="[@field:File]"]Click here to read the document[/url] ELSE 'The document hasn't been uploaded yet.' END But this doesn't work. When I want to go the the details page I get Error in formula. Do you have any suggestions? I can't upload the file to Caspio, so that is not an option. Thanks! Bjorn Hi Bjorn, You cannot write HTML code in calculated field. The best solution is to add html block with Java Script instead of calculated field: if( '[@field:File]' != "") document.write('Click here to read the document'); else document.write('The document hasn't been uploaded yet.'); Walter 1 Quote Link to comment Share on other sites More sharing options...
BjornSkifs Posted May 7, 2012 Author Report Share Posted May 7, 2012 I want to have a calculated field where the user either sees a link to click on (which redirects to a document), or sees a message "The document hasn't been uploaded yet". I tried to do this by having the following in a calculated field: CASE WHEN [@field:File]<>'' THEN [url="[@field:File]"]Click here to read the document[/url] ELSE 'The document hasn't been uploaded yet.' END But this doesn't work. When I want to go the the details page I get Error in formula. Do you have any suggestions? I can't upload the file to Caspio, so that is not an option. Thanks! Bjorn Hi Bjorn, You cannot write HTML code in calculated field. The best solution is to add html block with Java Script instead of calculated field: if( '[@field:File]' != "") document.write('Click here to read the document'); else document.write('The document hasn't been uploaded yet.'); Beautiful casyana! Thank you so much for your reply! Have a nice week! Quote Link to comment Share on other sites More sharing options...
Cameron Posted April 1, 2016 Report Share Posted April 1, 2016 Hi Bjorn, You cannot write HTML code in calculated field. The best solution is to add html block with Java Script instead of calculated field: <script> if( '[@field:File]' != "") document.write('Click here to read the document'); else document.write('The document has not been uploaded yet.'); </script> Thank you, Casyana! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.