help with JavaScript in PHWeb screen

Deskin, Bob Bob.Deskin@Cognos.COM
Wed, 27 Jun 2001 12:49:20 -0400


You don't get the error - that's good. I don't know about the space - you'd
have to ask Simon. As for the DESIGNER procedure, presumably it's running or
you'd get another type of error. What's it doing? Can you show us the code?

Bob

-----Original Message-----
From: Edis, Bob [mailto:bob.edis@fleetpride.com]
Sent: Wednesday, June 27, 2001 12:42 PM
To: 'powerh-l@list.swau.edu'
Subject: RE: help with JavaScript in PHWeb screen


Thanks Jean

My HTML reference (HomeSite 4.0) does not have <FORM NAME=...> as an option.
It does show <FORM ID=...> but I tried that and it doesn't work.  At Bob D's
suggestion I tried using <FORM NAME=...> and now I don't get the JavaScript
error.  However the button doesn't call the LINKSCREEN as defined in the
designer procedure either.

Why do I need to put a space after CINV?

Regards,
Blue

-----Original Message-----
From: Fortin, Jean-Pierre [mailto:Jean-Pierre.Fortin@cognos.com]
Sent: Wednesday, June 27, 2001 11:26 AM
To: 'Edis, Bob'; 'powerh-l@list.swau.edu'
Subject: RE: help with JavaScript in PHWeb screen


You must give a name to your form, as in:

<form action="/cgi-bin/phcgi.exe" method="POST" name=form1>

Since you are using "form1" in your javascript.

Also the UserAction will be:

   <input type="button" onclick="UserAction('CINV ')" value="Select Specific
Invoice">

Note the is a blank(space) after the V and the quote.

This should resolve your problem.

/ JP

-----Original Message-----
From: Edis, Bob [mailto:bob.edis@fleetpride.com]
Sent: Wednesday, June 27, 2001 12:12 PM
To: 'powerh-l@list.swau.edu'
Subject: help with JavaScript in PHWeb screen


G'day all

Environment: 
PH Web 2.21D3
PH 4GL 8.21D4
I.E. 5.0
Windows NT 4.0 sp6

I am trying to create a button on a PH Web HTML template where the button
will trigger a designer procedure.  When I run the template in IE5.0 and
click on the resulting button I get this JavaScript error:

-------------------------------------------------------
A runtime error has occurred.

Error: 'self.document.form1.PH_ACTION' is not an object
-------------------------------------------------------

Anybody know what the problem here is (besides me)?


Using the example in the documentation I have I have coded some JavaScript
as follows:

<script language="JavaScript">
 <!--
 function UserAction( action )
 {
  self.document.form1.PH_ACTION.action = action;
  self.document.form1.submit();
 }
 //-->
</script>
</head>
<body bgcolor="grey">

<!--PH:RECORD-->
<form action="/cgi-bin/phcgi.exe" method="POST">

The syntax used to in the body of the form is:

   <input type="button" onclick="UserAction('CINV')" value="Select Specific
Invoice">

Regards,

Blue

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.

= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.swau.edu
Subscribe: "subscribe" in message body to powerh-l-request@lists.swau.edu
Unsubscribe: "unsubscribe" in message body to
powerh-l-request@lists.swau.edu
http://lists.swau.edu/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.