Link to home
Start Free TrialLog in
Avatar of davidweekleyhomes
davidweekleyhomesFlag for United States of America

asked on

Onchange event - want to change another field in web based form Notes 6.5

I have an online form in Lotus Notes 6.5 that was developed by someone else and I am trying to make changes to it. It has one field, System, that is a dialog box of choices. The field has an Onchange event in which other sections of the form are displayed or hidden.
I added a new section in the Onchange Javascript that will have a link to a URL. The URL will pass a parameter which should be the system, like www.xxxxxx.com?system=ZZZZZZ.
I have tried having the link as Computed Text but that doesn't seem to work since the document is not being saved or refreshed.
I read some ideas and tried checking "Refresh fields on keyword change". But that just made the hidden fields display briefly before going away, so I set that back.
I tried calculating the value of the URL in the Onchange event for System. I know it works since the field is correct after the document is saved but if I try to put a field in the new link section that has the value of this calculated field, it doesn't load since I make it a computed field.
How can I get the URL link to be dynamic based on the value of the System field?
Thanks!
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

The examples you give are all Notes-client related or require an update of the form by the server. The form is shown in a browser, so if you want a direct change (without server intervention) you have to use browser-side JavaScript.

An example:
      document.form[0].fieldX.value = "FieldY is " + document.form[0].fieldY.value

Can you show us some code, because we can give much better answers when we don't have to guess or assume.
You can retrieve the selected value from a dialog (in onChange) by:

v = this[this.selectedIndex].text // (for the selected value on the screen)
v = this[this.selectedIndex].value // (for its alias)

FYI: I'm using 'this' to reference the current field.

The url would then be:

'www.xxxxxx.com?system' + v
ASKER CERTIFIED SOLUTION
Avatar of davidweekleyhomes
davidweekleyhomes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of davidweekleyhomes

ASKER

It looks like to get that link on the form that I need to insert a hotspot. I had no luck with this and finally just tried to insert a hotspot for URL, entering http://www.yahoo.com. That did not even show as a link on the form and the view source didn't even show it at all. Is there some overall form setting that is preventing hotspots from appearing on the web page? I could not seem to find one. We have very few web enabled databases at our site so no real examples to check out here.

Once I get past this and format the URL like you suggest, I am still a little unclear about what will be in the Javascript function, how the function will know to display the field. Thanks for being so responsive.
You will probably need to add HTML to the form, and set it to passthru-HTML (a text property).

Try first with

     <a href="www.yahoo.com">click here for Yahoo</a>

Ah, there was a typo in the code in my earlier post: it should have read href="#"
I am just not strong enough in Lotus Notes on the web to get the link to have a variable parameter.  I will have to approach this differently. I will award points based on your help, thanks!