Re: (Webserver3.0) Copying the HTML.Form field value into a oracle variable.

From: Richard Hall <rjhall_at_uk.oracle.com>
Date: 1999/03/02
Message-ID: <36DBBB92.9D2F0859_at_uk.oracle.com>#1/1


it would be nicer to use one procedure... create or replace procedure myProc(name in varchar2 default null) as begin
  if name is null then
    ...build form...
    htp.formText(cname => 'name');
  else
    process form
end if;
end myProc;

Christopher Beck wrote:

> On Mon, 01 Mar 1999 22:57:20 GMT, "ad" <aravind.doma_at_cwusa.com> wrote:
>
> >Oracle Guru's,
> >Here's one for you.
> >
> >Is there a way to copy a HTML.FORM field value into a oracle variable? and
> >Is it possible to access a oracle variable from a javascript?
> >
> >Procedure X Is
> >tName Varchar2(50);
> >
> >Begin
> >htp.prn('
> ><HTML>
> ><HEAD>
> ><SCRIPT LANGUAGE="JavaScript"
> >function ftest()
> >{
> >Can i access tName here? If so how?
> >}
> >
> ></SCRIPT>
> ></HEAD>
> ><BODY>
> ><FORM ......>
> ><INPUT TYPE="TEXT" NAME="Name">
> >');
> >//Is it possible to access the value from the above input field (Name) into
> >the
> >oracle variable tName decalred above? If so how?
> >htp.prn('
> ></FORM>
> ></BODY>
> >');
> >End;
>
> I think what you want is two procedures. One that will draw the page
> and one that will accept the posting of the HTML form.
>
> eg.
>
> create or replace
> procedure draw_page as
> l_tname varchar2(50);
> begin
> htp.htmlOpen;
> htp.headOpen;
> htp.p( '<script language="JavaScript">' );
> htp.p( 'function ftest()' );
> htp.p( '{' );
> htp.p( ' var javaScriptVariable = ' || l_tname );
> htp.p( ' // do more stuff' );
> htp.p( '}' );
> htp.p( '</script>' );
> htp.headClose;
> htp.bodyOpen;
> htp.formOpen( 'accept_posting' );
> htp.p( 'What is your name?' );
> htp.formText( 'p_name' );
> htp.formSubmit;
> htp.formClose;
> htp.bodyClose;
> htp.htmlClose;
> end draw_page;
> /
>
> Now we need a procedure that will accept the the submit
> of that HTML form( accept_posting ). Its name must the url of the form
> and its inputs must match the names of the HTML form items ( p_name ).
>
> procedure accept_posting( p_name varchar2 ) is
> begin
> htp.p( 'Hi ' || p_name || ', nice to meet you.' );
> end accept_posting;
> /
>
>
> I hope this helps.
>
> chris.
>
> >
> >Any help is appreciated.
> >Thanks a lot in advance.
> >AD
> >
> >
> >
>
> --
> Christopher Beck
> Oracle Corporation
> clbeck_at_us.oracle.com
> Reston, VA.
> ----------------------------------------------------------------------------
> Opinions are mine and do not necessarily reflect those of Oracle Corporation

--
Richard

The statements and opinions expressed here are my own and
do not necessarily represent those of Oracle Corporation.
Received on Tue Mar 02 1999 - 00:00:00 CET

Original text of this message