Skip to main content
This forum is closed to new posts and responses. New discussions are now taking place in the IBM Developer Answers forum.
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 6 and 7 Forum

Notes/Domino 6 and 7 Forum

developerWorks

  

PreviousPrevious NextNext

RE: Need help to display the prompt box using javascript on web
Matt Pethig 2.Aug.17 05:22 PM a Web browser
Domino Designer All Releases All Platforms


This may also help you get started. I had a form where I wanted the admins to be able to select a user to remove from a Business Case and the reason for removal, so there are two questions asked in the prompts in this snippet. My prompt form is called RemoveUser and when I open it I pass it &users=message.
message is just a variable that I set earlier in the code and is used to set the options for the list of users that are currently listed on the document, so it is dynamic as the list displayed will be different for each Business Case

Main Form action button
.....rest of code
var pathname = (window.location.pathname);

var retval = window.showModalDialog(pathname.substring(0,(pathname.lastIndexOf('.nsf')+5))+'RemoveUser?OpenForm&users=' + message,"" ,"dialogWidth: 630px;dialogHeight: 480px;status: yes;unadorned: yes;scroll: yes;help: no;resizable: yes;");
...rest of code

The retval variable is set by window.returnValue in the second OK button. I had two return values seperated by a newline character so I split on the newlines and then had two values that I could set fields to in the Main form


RemoveUser Form
OK Button 1 - user variable is a global so value is set in first OK button and retrieved in second OK button

var f = document.forms[0];
var selection = false;
var numberselected = 0;
var chosen = 0;

for (i = 0; i < f.UserList.length; i++)
{
if (f.UserList.options[i].selected == true)
{
//one option must be selected or error message displayed
selection = true;
//field is set to multi value for display purposes but only one user can be selected
numberselected++;
//store option selected which will be returned to parent window
chosen = i;
}
}

if (selection == false)
{
alert ("Please select the user to remove from the Business Case");
f.UserList.focus();
return;
}

if (numberselected > 1) {
alert ("You can only select one user to remove from the Business Case");
f.UserList.focus();
return;
}

document.getElementById("selectuser").style.display = "none";
document.getElementById("selectreason").style.display = "block";

user = f.UserList[chosen].text;


OK Button 2
var f = document.forms[0];
var selection = false;
var chosen = 0;

for (i = 0; i < f.Reason.length; i++)
{
if (f.Reason[i].checked == true)
{
//one option must be selected or error message displayed
selection = true;
//store option selected which will be returned to parent window
chosen = i;
}
}

if (selection == false)
{
alert ("Please select the reason for removing from the Business Case");
f.Reasonfocus();
return;
}

window.returnValue = user + "\n" + f.Reason[chosen].value;
window.close();




Need help to display the prompt box... (Revathi p 1.Aug.17)
. . RE: Need help to display the prompt... (Matt Pethig 2.Aug.17)
. . A quick google search found this (Carl Tyler 1.Aug.17)


Document Options






  Document options
Print this pagePrint this page

Search this forum

Forum views and search


  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Connections Cloud Developers
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite