Solved

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

Posted on 2009-07-14
7
1,185 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
ID: 24858301
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
ID: 24858339
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
ID: 24859933
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 50 total points
ID: 24860027
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
ID: 24860752
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
ID: 24887577
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
ID: 25024545
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

776 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