Hello NetDs,

The following is what Janet has achieved for ND 3. (Pls. see code at the
end)

I am now trying to do the same in ND4. There seem to 
a problem especially on:

                       document.pgXXX.action =
                  "../PrXYZ/pgXXX.onLoadTasksWebEvent(LoadTasks)";

part of this solution.


here is what i am doing in JS:

     document.pagAccts.action =
"../NewsWeb/pagAccts.btnRefresh_onWebEvent(btnRefresh)";
     document.pagAccts.submit();

        ........
        .......
& here is the commented button within the page's HTML:

        <INPUT TYPE=SUBMIT NAME="btnRefresh_onWebEvent(btnRefresh)"
VALUE="Refresh" >

The page goes thru a normal reload rather than, the web event of 
invisible button.  The action value set is not recognised by ND.


Thanks in advance for any help.

regards,
Raj





                    Javascript: trigger event for invisible button -
SOLUTION  (in ND3)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                    Date:
                         Thu, 25 Mar 1999 18:25:21 -0500 
                    From:
                         [EMAIL PROTECTED] 



                  Thanks for the replies Sridhar, Grace and Brendan.

                  Here's some details on how we solved it.
                  NOTE: This is an ND3 app.

                  1. comment out the button to hide it:
                  <!-- **btnLoadTasks**  This is commented because it is
called via
                  Javascript: chgProjWP() -->

                  2. alter the default HTML for the comboBox to also
contain:
                  OnChange=chgProjWP()

                  3. in the Javascript function being called by the onChange
event, instead
                  of just doing this:
                  function chgProjWP()
                  {
                       ...
 
document.pgXXX.elements["onLoadTasksWebEvent(LoadTasks)"].click();
                  }

                  we replaced that line with Brendan's tip about setting
"action" for the
                  form and then calling submit on the form:

                  function chgProjWP()
                  {
                       ....
                       document.pgXXX.action =
                  "../PrXYZ/pgXXX.onLoadTasksWebEvent(LoadTasks)";
                       document.pgXXX.submit();
                  }

                  It works and we're happy and grateful! If anyone sees
something we could
                  have done better, let me know.

                  Janet



 

                   (Embedded

                   image moved   "Johnston, Brendan  " <[EMAIL PROTECTED]>

                   to file:      03/24/99 01:00 PM

                   pic09839.pcx)

 




                  Subject:  RE: [ND] Javascript: trigger event for invisible
button




                  Janet,

                  I would like invisible the image button approach if
JavaScript worked with
                  images.

                  Given that it does not, my favorite option is to comment
out the button
                  **btName** tag in the HTML file and add the explanation
that the event is
                  triggered with JavaScript.  This is the same as set
visible(false).

                  In the JavaScript on change handler for the drop down you
will need add the
                  buttons name value pair to the action field of the form
tag then call
                  submit
                  on the form object.

                  Brendan Johnston
                  TeamND


                       -----Original Message-----
                       From:     Grace Frederick [SMTP:[EMAIL PROTECTED]]
                       Sent:     Wednesday, March 24, 1999 4:11 AM
                       To:  [EMAIL PROTECTED];
                  [EMAIL PROTECTED]
                       Subject:  Re: [ND] Javascript: trigger event for
invisible
                  button

                       Two possiblities:
                       1. Create a 1px x 1 px image button where the image
is transparent.

                       2. Rather than calling
../projName/pgName.btn_onWebEvent, call
                       ../projName/pgName
                       This will cause the page to be loaded (as it would if
you just
                  requested the
                       page directly).  I'm not sure if that will work, but
it's worth a
                  shot.

                       == Grace


                       ----- Original Message -----
                       From: <[EMAIL PROTECTED]>
                       To:
<[EMAIL PROTECTED]>
                       Sent: Wednesday, March 24, 1999 3:45 AM
                       Subject: [ND] Javascript: trigger event for invisible
button


                       >
                       >
                       >
                       > In the onChange event of a drop-down we want to
make a call to our
                       database
                       > to populate another drop-down on the same page.
Since we need to
                  submit
                       the
                       > form to do this database stuff, we added a "dummy"
button with no
                  display
                       > label (i.e. its HTML attribute TEXT ="") to the
page. And then in
                  the
                       > onChange event, we just call click() on this
button. It works, but
                  our
                       > dummy button looks silly because it is a very
narrow button (not
                  invisible
                       > like we wanted).
                       >
                       >
                       > What would be the best way to handle this? Should
we just do a
                  setVisible
                       > (false); in the button's onBeforeDisplayEvent to
hide it?
                       >
                       > Thanks,
                       > janet
                       >
                       >


_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to