🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.intrabuilder.forms
2 messages
2 total messages Started by Werner Renhardt Mon, 10 Aug 1998 00:00
Are there 'onServerSubmit' - parameters?
#125
Author: Werner Renhardt
Date: Mon, 10 Aug 1998 00:00
23 lines
1430 bytes
I use a HTML Object(e.g.: 'htmlButton') to "simulate" a button-Object in
a form:
To do so, I set the text property of 'htmlButton':
this.form.htmlButton.text = '<input type="submit" name="buttonname"
value="buttontext">'

When I view the form in the browser i can see the button, and when I
click on it,
the forms 'onServerSubmit'-event is executed.

P R O B L E M :  When 'onServerSubmit' is executed, is there a
parameter/function/... to find out which button was pressed (in order to
get name or value of the button. In this case "buttonname" or
"buttontext").

But  W I T H O U T  using a hidden-Object which was set by client-side
javascript.
(Because I want dynamically create a list of buttons in a form: so
combining each button with a javascript-function would enlarge the
generated HTML-File)

Or is there no possibility to do so? (and I must do it with javascript
and hidden-Object)
Re: Are there 'onServerSubmit' - parameters?
#132
Author: Marcelo M. Marques
Date: Sat, 15 Aug 1998 00:00
50 lines
2445 bytes
Hi, Werner

Let's see if I can give some suggestion for your case.

>---------------------------------------------------------------
>P R O B L E M :  When 'onServerSubmit' is executed, is there a
>parameter/function/... to find out which button was pressed (in order 
>to get name or value of the button. In this case "buttonname" or
>"buttontext").
>
>But  W I T H O U T  using a hidden-Object which was set by client-side
>javascript. (Because I want dynamically create a list of buttons in a 
>form: so combining each button with a javascript-function would enlarge 
>the generated HTML-File)
>---------------------------------------------------------------

First, there is no way to receive parameters directly by the "onServerSubmit" event, but
YES, you can use Hidden objects to pass them. I use the following scheme and it seems not
to enlarge the file:

1) You do this for the "button" HTML text property:

this.form.htmlButton.text = <A HREF="javascript:ButtonPressed(\'buttonname\')"><img
src='/images/SOMEBUTTON.JPG'></A>";

Note: You can build the above line dynamically in the code 
(eg: on "pre_Render" event) putting the desired "buttonname" at the moment. I do this way
and it works nice. You can enhance the above HREF with your needs, OK?

2) Then you need to export only this java function to make it go:

function ButtonPressed(buttoname)
{
   document.forms[0].elements["WhichButtonPressed"].value = buttoname;
   document.forms[0].elements[1].value = -1;
   document.forms[0].submit();
}

3) You will need to add that "WhichButtonPressed" Hidden object in the pageno ZERO of all
your forms, but what's the bad on it ?  


I hope this helps,

Regards,
Marcelo
from Rio, Brazil
-- 
       ---------------------------------------------------------
       "Who is General Failure, and why is he reading my drive?"
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads