JavaScript with Formula

I’m using this formula, but nothing happens.@If(Form != “Contact”; @Do(“<SCRIPT Language="JavaScript">Alert(‘Teste de Jas’)”;@Return(“”)); @Command([Compose];“ReportWeb”))

Someone, Can help me?

Thanks

Subject: JavaScript with Formula

Hi Luiz,unless Notes 6 has radically changed from 5, as far as I know you can’t combine formula and javascript like that.

If you are using this in the client, why not use @prompt.

If you are using it on the web you will have to put it all into javascript, which would be quite easy.

Susan

Subject: RE: JavaScript with Formula

Thanks Sussan, but I don´t know javascript very weel. Can you help me?

Thanks again

Subject: RE: JavaScript with Formula

There are loads of websites out there that can give you the basics on javascript.Here is the code for what you need to do. It is not perfect, but it will give you a start. The websites will help you out too.

if(document.forms[0].Form!=“Contact”)

{

alert(“Teste de Jas”)

return()

}

else

{

window.open(/ReportWeb?openform)

}

Subject: RE: JavaScript with Formula

Susan,

You most definitely can combine @formula language and JavaScript. You do it in computed text that is marked as Pass-Thru HTML. The net result will be JavaScript code that appears on the web page.

Luiz’s problem was that he misspelled alert() with a capital letter and didn’t end the statement with a semicolon.

You have errors in your sample code. These lines…

alert(“Teste de Jas”)

return()

…should be…

alert(“Teste d Jas”);

return false;

Ken

Subject: RE: JavaScript with Formula

I made my code as like this:if(document.forms[0].Form!=“Contact”)

{

alert(“Teste de Jas”)

return false

}

else

{

alert(“Teste de Jas2”)

}

Are there some wrong?

Thanks