Solved

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

Posted on 2009-07-14
7
1,176 Views
Last Modified: 2013-12-18
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!
0
Comment
Question by:davidweekleyhomes
  • 3
  • 3
7 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
 
LVL 13

Expert Comment

by:CRAK
Comment Utility
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
 

Accepted Solution

by:
davidweekleyhomes earned 0 total points
Comment Utility
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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 50 total points
Comment Utility
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
 

Author Comment

by:davidweekleyhomes
Comment Utility
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
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
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
 

Author Comment

by:davidweekleyhomes
Comment Utility
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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now