Simle JS question - need sytax for getting value from field

Can anyone tell me the correct syntax for this please

location.href = Document.LaunchURL

LaunchURL is a field in my doc that equates to a URL

This is in the OnLoad event

Subject: Simle JS question - need sytax for getting value from field

location.href = document.forms[0].LaunchURL.value;

Subject: RE: Simle JS question - need sytax for getting value from field

Thanks, but it doesn’t work can anyone see why?I have chanegd the LaunchURL field to have http://www.Lotus.com in it, but it still doesn’t work

Subject: RE: Simle JS question - need sytax for getting value from field

Chris,

Esther’s solution is 100% correct for a text input field (you haven’t told us if this is a select dropdown field, checkbox, or radio button). Judging by the number of misspelled words in your posting, the first thing I would suggest is to doublecheck your spelling in the code. JavaScript is case sensitive, by the way.

Otherwise, view the page source in your web browser and copy and paste the portion of the HTML that generates the LaunchURL field so we can see how it looks.

Ken

Subject: RE: Simle JS question - need sytax for getting value from field

Hey therez nuting rong wiv my spelin !!

Anyway, you gave me an idea. The field !!!

The doc is in Read mode not edit mode so there is no field for JS to work with as Doino delivers a string of text and only delivers a field in edit mode. So, I changed my computed field with the URL in it to an editable field and sure enough it works - BUT only in edit mode. So how do I get the value when the doc is in read mode?

Subject: RE: Simle JS question - need sytax for getting value from field

Chris,

Create a hidden text field via computed text as shown below.

“<INPUT TYPE=HIDDEN NAME=LaunchURL value="” + LaunchURL + “">”

Then you need to set a hide-when formula so that this computed text only appears when the real LaunchURL field is absent.

Ken

Subject: RE: Simle JS question - need sytax for getting value from field

Thanks - will give it a go, sounds like a winner. Thanks again

Subject: Simle JS question - need sytax for getting value from field

hello,Can u tell me how to add any HTML code on LOtus Notes page.

I paste the code in a new page but when I view the code in browser it is showing the same contents not the fields n all…

can u tell me what’s the reason

Thanx

Subject: RE: Simle JS question - need sytax for getting value from field

You can add html ib two ways

  1. Paste/type the code onto the page without using square brackets. Highlight the whole HTML code and click Text/Passthru HTML.

  2. Create ComputedText (Create Menu) and type your notes code in the bottom section of the page, but resulting HTML must have square brackets around it