Improve company productivity with a Business Account.Sign Up

x
?
Solved

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

Posted on 2009-07-14
7
Medium Priority
?
1,306 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 200 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

601 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