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!
davidweekleyhomesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sjef BosmanGroupware ConsultantCommented:
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.
0
CRAKCommented:
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
0
davidweekleyhomesAuthor Commented:
Thanks for the comments.
In the Onchange event Javascript I set a field up like the code below.
The system=getchoice was already in there so I added the next line to set the value of my link field. (It has a dummy URL for now). It appears to work since the document has this field saved like I would expect, with the system as part of the URL. But I am not sure if this is just because the field is getting refreshed at save time.

If the system entered is BlackBerry, then the other bit of code is executed which shows the FAQSection which I added to the form.
I can't figure out how to display the URL. I tried putting a field where it says <Computed value> that pulls the value of my FAQLink field. But if I left it as editable, it caused a text box on the form and I just want to display it. So that is why I tried the computed value and of course, that doesn't populate with the revised FAQLink value.


system=getChoice("SystemSW");
this.form.FAQLink.value="<a href=http://www.xxx.com?system="+getChoice("SystemSW")+">http://www.faq.com?system="+getChoice("SystemSW")+"</a>";
<<snip>>
//BlackBerry Question
if (system=="BlackBerry") {
   toggleVisibility("FAQSection", "show");
   toggleVisibility("IssueSection", "show");
   toggleVisibility("QuestionSection", "show");      
   this.form.Comments.focus()
  
  Question = "Is this a new phone activation? If so, what kind of phone do you have? \n\n  Answer: \n\nCan you send/receive emails? \n\n  Answer:"; 
 
 this.form.Problem.value = Question
 }
<<Then this comes from the form>>
<div id="FAQSection" style="visibility:hidden;display:none">
<table width="100%" border="0" cellSpacing=0 cellPadding=0 >
  <tr >
    <td colspan=3 align="left" valign="top" <p><font color="cc0033" size="3" face="Arial, Helvetica, sans-serif"></font><span class = "subheader">To read the Frequently Asked Questions in case any of them help you with your issue, just go to this link: &nbsp;<Computed Value>   <p>&nbsp;    </td>
  </tr>
  </table>
</div>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

Sjef BosmanGroupware ConsultantCommented:
You want to display the link, or do you want a user to click it?? If just clicking will do, you can use
      <a href=#" onclick="javascriptfunction();">click here</a>

and define your function to grab the field:

function javascriptfunction() {
blah-dih-blah...
}
0
davidweekleyhomesAuthor Commented:
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.
0
Sjef BosmanGroupware ConsultantCommented:
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="#"
0
davidweekleyhomesAuthor Commented:
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!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.