How to get my page to wait for input before proceeding

Have the following code.  It presently goes immediately into the update process.   I would like for it to rather bring up a button that the user has to press to do the update.  I want the main screen to be a little tutorial which they can either read or they can press the update button to continue the client software push.  Thanks

<HTML>
<HEAD>

  <!--
  Comments on the 'JWalkX1' object.

  -->

<TITLE>CBJWalkX Update Home Page</TITLE>
</HEAD>
<BODY BACKGROUND="" bgcolors="#FFFFFF" link="#0000FF" vlink="#800080" top margin="0" leftmargin="0"
<p>




<BODY>

  <p>&nbsp;</p>
  <p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <img border="0" src="msw-logo.gif" width="348" height="136"></p>




<P> This is the MSW JWalk Windows Client Updater. Please wait as the load process may take a minute.
<BODY>

  <OBJECT ID="JWalkX1" WIDTH=32 HEIGHT=32
    CLASSID="CLSID:E7C44C86-0CD3-11D2-9311-00A0247A4E65"
    CODEBASE="http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkx.cab#version=4,566,1,43">
    <PARAM NAME="Parameters" VALUE="/h192.168.1.1 http://jwalkupdate.computerbodyguards.com/jwalkapp/example/example.jwc /M2924 /GMAIWS=2">
    <PARAM NAME="ClientLocationSetup" VALUE="http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkxs.exe">
    <PARAM NAME="RequiredVersion" VALUE="Version 4.0C11.1.43">
    <PARAM NAME="IndependentWindow" VALUE="NO">
    <PARAM NAME="StartSession" VALUE="YES">

    <!--
    <PARAM NAME="UseMainPanelSizeAsDefault" VALUE="NO">
    <PARAM NAME="silentClientInstallDirectory" VALUE="C:\Program Files\SEAGULL\J Walk Windows Client">
    <PARAM NAME="clientInstallModeSilent" VALUE="NO">
    <PARAM NAME="silentClientFilesToInstall" VALUE="http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkxs.cab">
    <PARAM NAME="silentClientProgramFolderName" VALUE="C:\Program Files\SEAGULL\J Walk Windows Client">
  -->

<SCRIPT LANGUAGE="JavaScript">
<!-- Hide script for older browsers
var xpiFile = "http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkp.xpi";
var xpiVersion = "4.566.1.43";
var pluginRegName = "Seagull J Walk Client Plugin v4.566.1.43";
var packageName = "plugins/jwalkx";
var jarFile = "http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkp.jar";

var agt=navigator.userAgent.toLowerCase();
var is_major = parseInt(navigator.appVersion);
var is_minor = parseFloat(navigator.appVersion);
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_nav4up = (is_nav && (is_major >= 4));
var is_nav6up = (is_nav && (is_major >= 5));

if(navigator.appName == "Netscape")
  {
  if (navigator.platform == "Win32")
    {
    if (is_nav6up )
      {
      doXPInstall();
      }
    else if ( is_nav4up )
      {
      doJARInstall();
      }
    else
      {
      var newWin = window.open("http://jwalkupdate.computerbodyguards.com/jwalkxs/upgrade.html", "UpdatePopUp", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=460,height=500');
      }
    }
  else
    {
    alert("This plugin requires Windows NT/9x or greater.");
    }
  }

function doXPInstall()
{
 if (InstallTrigger.updateEnabled())
 {
  var installed_version = InstallTrigger.getVersion(packageName);
  var is_new_plugin = ((installed_version == null)
            || (InstallTrigger.compareVersion(packageName,xpiVersion) < 0)
            || (!navigator.plugins[pluginRegName]));

  if(is_new_plugin)
   {
    var xpiInstallation = new Object();
    xpiInstallation[pluginRegName] = xpiFile
    InstallTrigger.install(xpiInstallation, xpinstallCallback);
   }
 }
 else
  {
  alert("Please enable the software installation and resume this operation.");
  }
}

function xpinstallCallback(url,status)
{
  if(status == 0 || status == 999 )
    {
    alert("Please, restart the browser to complete the installation process.");
    }
  else if(status != 0 && status != 999 )
    {
    alert("Install FAILED with error: " + status);
    }
}

function doJARInstall()
{
if ( navigator.javaEnabled() )
  {
  trigger = netscape.softupdate.Trigger;
  if ( trigger.UpdateEnabled() )
    {
    vi = new netscape.softupdate.VersionInfo(4,566,1,43);
    installed_version = trigger.GetVersionInfo(packageName);
    if (installed_version == null || installed_version.compareTo(vi) < 0 || !navigator.plugins[pluginRegName])
      {
      trigger.ConditionalSoftwareUpdate(jarFile,packageName, vi, trigger.FORCE_MODE);
      }
    }
  else
    {
    alert("Enable SmartUpdate before running this script.");
    }
  }
else
  {
  alert("Enable Java before running this script.");
  }
}
// -->
</SCRIPT>
<p><embed WIDTH=640 HEIGHT=488 TYPE="application/x-jwalkx"
Parameters="/h192.168.1.1 http://jwalkupdate.computerbodyguards.com/jwalkapp/example/example.jwc /M2924 /GMAIWS=2"
IndependentWindow="NO"
RequiredVersion="Version 4.0C11.1.43"
StartSession="YES"
ClientLocationSetup="http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkxs.exe"
silentClientInstallDirectory="C:\Program Files\SEAGULL\J Walk Windows Client"
clientInstallModeSilent="NO"
silentClientFilesToInstall="http://jwalkupdate.computerbodyguards.com/jwalkxs/jwalkxs.cab"
silentClientProgramFolderName="C:\Program Files\SEAGULL\J Walk Windows Client"></p>
</EMBED></OBJECT>
</BODY>
  <p>If you see the following at the top of your browser, please click on it:</p>
  <p><img border="0" src="activx_control_msg_top.GIF" width="703" height="150"></p>
</BODY>
</HTML>
jjackson2004Asked:
Who is Participating?
 
Pravin AsarConnect With a Mentor Principal Systems EngineerCommented:
If I understood correctly based on your last post..

If you have a some value set , and based on that value you want to

1. Have Update button active.
2. On click on "Update" button, run a particular script

Try this one..

<html>
<script language="javascript">
var updateValue = "1.5";
function RunUpdateScript () {
alert ('Update Script runs now');
}
function SetUpdateBtn () {
   document.getElementById ('updateBtn').disabled = false;
   if (updateValue == "2.0") {
        document.getElementById ('updateBtn').disabled = true;
   }
}
</script>
<body onload="SetUpdateBtn();">
<form>
<input id="updateBtn" type="button" value="Update" onclick="RunUpdateScript();">
</form>
</body>
</html>
0
 
Pravin AsarPrincipal Systems EngineerCommented:
Use confirm   or  prompt (if you need additional user inputs).



e.g

<script language="javascript">

var conf = confirm ("Continue");
if (!conf) { alert ('I do not want to Continue'); }

</script>
0
 
jjackson2004Author Commented:

Need more information.   First question is where do you put it on the page in relation to the other scripts.  Would prefer it to be an "Update" button that they press whenever and only active if the popup came up telling the user that they need to update.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

 
Pravin AsarPrincipal Systems EngineerCommented:
Here is a example for you.

A form is filled, when ever user changes any text, he is alerted about the changes, and
then prompted to confirm, if he likes to continue..




Please try this one.

<html>
<head>
<title>Form Confirm Document</title>
</head>

<body>
<script language="javascript">
var formFlds=null;
function formFldData (fld) {
   this.name = fld.name;
   this.value = fld.value;
}
function SaveChanges(theForm) {
   formFlds = new Array();
   if (!theForm) { return false; }
   for (var ix=0; ix < theForm.elements.length; ix++) {
         formFlds[ix] = new formFldData(theForm.elements[ix]);
   }
}

function FindFld (fld) {
   var str = null;
   if (!fld) { return; }
   for (var ix=0; ix < formFlds.length; ix++) {
         if (!fld.name) { continue; }
         if (!formFlds[ix].name) { continue; }
       if (exactMatch(fld.name,formFlds[ix].name)) {
            if (!exactMatch(fld.value,formFlds[ix].value)) {
                str = '\n Field Name:' + fld.name + '\n    New Value:' + fld.value + '\n    Old Value:' + formFlds[ix].value;
                break;
            }
         }
   }
   return str;
}
function exactMatch(s1, s2) {
   if (!s1) { return false; }
   if (!s2) { return false; }
   if (s1.length == s2.length) {
      if (s1.match(s2) && s2.match(s1)) { return true; }
   }
   return false;
}
function CheckChanged(theForm) {
      var changed = false;
    if (!theForm) { return changed; }
    var msgStr = '';
    for (var ex=0; ex < theForm.elements.length; ex++) {
       var str = FindFld (theForm.elements[ex]);
       if (str) {
               changed = true;
                  msgStr += str;
            }
    }
    if (changed) {
            msgStr = 'Following fields are changed\n' + msgStr;
    }
    else {
            msgStr = 'Nothing is changed\n';
    }
      alert (msgStr);
    return changed;    
}
function submitForm(theForm) {
if (CheckChanged(theForm)) {
      var conf = confirm ('Field Values changed, You want to continue');
      if (!conf) { return false; }
}
return true;
}
</script>
<form name="MyForm"  method="get" onsubmit="return submitForm(this);">
<br>First Name:<input type="text" name="firstname"  value="FIRSTNAME">
<br>Last Name:<input type="text" name="lastname" value="LASTNAME">
<br><input  type="reset" value="Reset"><input  type="submit" value="Submit Form">
</form>
<script language="javascript">
if (document.MyForm) { SaveChanges(document.MyForm); }
</script>
</body>
</html>
0
 
jjackson2004Author Commented:
Looks good, but not what I need.  

I need the script to check for the version number to run.  If it finds a version update is needed, then set a logical value.  This logical is used to set the update button active or inactive.  If an update is not needed, then popup and say no update is needed.  If an update is needed then the update button needs to be active.  When the update button is pressed, then the other javascripts need to execute.
0
 
jjackson2004Author Commented:
Added some more points.  Now can you show me where you would put your examples in the original code?
0
 
jjackson2004Author Commented:
Have not abaondoned this issue yet.  Just became sidetracked.   Back to being an active issue for me.
0
 
Cem TürkSenior Software EngineerCommented:
@jjackson2004 you should post pointer questions if you still want to find a solution otherwise nobody is interested in it in this situation, so please post pointer questions or ask mods to close this question in the community support area, thanks.
0
 
Pravin AsarPrincipal Systems EngineerCommented:
cem_turk
EE Cleanup Volunteer

Thanks for trying chase such abaondoned issues.

If jjackson2004 , does not want to close this one.

Refund the point to him and close the question.


0
 
jjackson2004Author Commented:
What is a pointer question?  This question has 350 points offered.  Are you stating that I should increase the point amount?  I have many projects going.  This one was sidetracked for a while, but it is not abandoned.

Or are you stating that my question is too broad and needs to be more focused?

0
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
This is a very old question

I think what you want is to take this out of the code

if(navigator.appName == "Netscape")
  {
  if (navigator.platform == "Win32")
    {
    if (is_nav6up )
      {
      doXPInstall();
      }
    else if ( is_nav4up )
      {
      doJARInstall();
      }
    else
      {
      var newWin = window.open("http://jwalkupdate.computerbodyguards.com/jwalkxs/upgrade.html", "UpdatePopUp", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=460,height=500');
      }
    }
  else
    {
    alert("This plugin requires Windows NT/9x or greater.");
    }


and put it in a new function

function doIt() {

if(navigator.appName == "Netscape")
  {
  if (navigator.platform == "Win32")
    {
    if (is_nav6up )
      {
      doXPInstall();
      }
    else if ( is_nav4up )
      {
      doJARInstall();
      }
    else
      {
      var newWin = window.open("http://jwalkupdate.computerbodyguards.com/jwalkxs/upgrade.html", "UpdatePopUp", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=460,height=500');
      }
    }
  else
    {
    alert("This plugin requires Windows NT/9x or greater.");
    }

}


and then add to the page:

<form><input type="button" onClick="doIt()" value="Click to Upgrade now"></form>

Michel
0
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.

All Courses

From novice to tech pro — start learning today.