Q
Problem solve Get help with specific problems with your technologies, process and projects.

Seeking workaround to allow users to add values on Web

I'm new to Lotus Notes development but have programmed in other languages for years. My question is: on a form that will be used via the Web by the user, the field is "Dialog List" with "allowing values to be added" checked, but it does not work on the Web--only in the client. What is a work-around? (I.e. For a new "fire-call" application, I want to present the Web user with a list of possible applications to choose from but also allow them to enter other applications (for audit requirements, what production application they've temporarily got "firecall' access to).

The <SELECT><SELECT> object used in HTML forms to create a drop-down list functions like a VB drop-down, you cannot add new entries to the list without making a trip back to the server, or by using some client side scripting (Javascript). You can use JavaScript to allow the user to add elements (which equate to data enclosed in <OPTION></OPTION> tags nested in the <SELECT> </SELECT> tags) to a drop-down, the following JavaScript function , when placed in a page, can be called to add elements to a list. Once the code is added, add a link or button to the form (illustrated below in the second <CODE></CODE> element) that passes the current field and a prompt value to guide the user. When clicked, an input prompt will be displayed and the suer can type in a value which will be added to the list is the user clicks the OK button in the prompt. This is one simple, but effective way to accomplish this:

<CODE> 
function addNewValue(objCurField, strPrompt){ 
// Last mods 010405.101901 
var strValue=window.prompt(strPrompt,""); 
        if(strValue !="" || strValue != 'null') { 
                   var curOptions=objCurField.options; 
                   var newOption= new Option(strValue,strValue,true); 
                   curOptions[curOptions.length]=newOption; 
                   objCurField.selectedIndex=curOptions.length-1; 
        } 
} 
</CODE> 
<CODE> 
<A class="font8pt" href="#" onClick="addNewValue(document.forms[0].tAssigned, 'Enter the name of the person assigned in the format Lastname, Firstname. e.g. Galt, John');">[Add]</A> 
</CODE> 

Hope that helps!


This was last published in January 2002

Dig Deeper on Lotus Notes Domino Administration Tools

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close