Manage Learn to apply best practices and optimize your operations.

Submit Your Form In Smart Way

Are you ever launch slow agent after submiting data form form ? Then probaly
you need to do such things that:
- inform user that data was send for processing
- submit the form
- prevent user from submiting the same data one again
- keep system reponsible for user.

The code bellow do the following when submit button is pressed :
- submit the form to server
- prevent user for pressing sumbit button again (using LaunchSubmit function)
- generate new web page with "Please wait" message (using function msgWait)
- generate button for redirete user to another page when neded (using fumction
goToNotesURL)

The code below is complete web page ready to run.
In Domino you shoud do the following
cerate any form
put java Script code in $$HTMLHead field
create SUBMIT button with the following code :
&LTI>onClick="launchSubmit(this.form)"</I>




&LTHTML>
<!-- Lotus-Domino (Release 4.6.3b (Intl -->
&LTHEAD>

&LTSCRIPT LANGUAGE="Javascript">
<!--

var submited = false

function launchSubmit(frm)
{
if ( submited == false ) {
frm.submit();
submited = true;
msgWait();
} else {

alert ("Your data was already submited")
}

}


function goToNotesURL (name) // return back to menu define in button
{
var protocol = window.location.protocol;
var host = window.location.host;
var port = window.location.port;
var pathname = window.location.pathname;
var newpath ="";
port != "" ? port= ":" +port : port;
newpath = pathname.slice(0,pathname.indexOf(".nsf")+4);
newpath = newpath +name
alert(newpath);
window.location.replace(newpath);
}





function msgWait() // Wait message during creation of TSE page generator
{
document.open();
document.write("&LTHTML>");
document.write("&LTHEAD>");
document.write("&LTSCRIPT Language='JavaScript'>");
document.write("function goToNotesURL(name)");
document.write("{");
document.write(" var protocol = window.location.protocol; ");
document.write(" var host = window.location.host;");
document.write(" var port = window.location.port;");
document.write(" var pathname = window.location.pathname;");
document.write(" var newpath ='';");
document.write(" port != '' ? port= ':' +port : port;");
document.write(" newpath = pathname.slice(0,pathname.indexOf('.nsf')+4);
");
document.write(" newpath = newpath +'/'+name;");
document.write(" window.location.replace(newpath); ");
document.write(" };");
document.write("</SCRIPT>");
document.write("</HEAD>");
document.writeln("&LTBODY>");
document.writeln("&LTCENTER>&LTFONT SIZE=+3 >&LTB>Please
wait</B></FONT>&LTCENTER>");
document.writeln("Your data was send to processing , you should wait until
processing finish . &LTBR> ");
document.writeln("You can use this button to run this application");
document.writeln("&LTBR>&LTCENTER>&LTINPUT TYPE='button' VALUE='Menu'
OnClick=\"goToNotesURL(\'?OpenDatabase\')\" ></CENTER>");
document.writeln("</BODY>");
document.writeln("</HTML>");
document.close();
}
-->
</SCRIPT>
&LTFORM METHOD=post ACTION="http://127.0.0.1/" NAME="_form1">&LTBR>
&LTINPUT NAME="tse_EmpeeID" VALUE="12345678">
&LTINPUT Type ="Button" NAME="Launch" VALUE="Submit this form"
OnClick="launchSubmit(this.form)" >
</FORM>
</BODY>
</HTML>

Dig Deeper on Lotus Notes Domino Administration Tools

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