-- formcatcher2 accepts the two parameters from form2,
-- and dispatches new_student2 if appropriate.

create or replace procedure formcatcher2
(theText in varchar2, theButton in varchar2)
--(theButton in varchar2, theText in varchar2)
as
i number;
begin
    if lower(theButton) = 'new student'
    then 
    	new_student2;
    	return;
    end if;
    
    htp.htmlOpen;
    htp.headOpen;
    htp.title('Form Catcher, two-param version');
    htp.headClose;
    htp.bodyOpen;

    htp.header(2, 'come here on click of submit button');

    htp.print('Here is the button parameter: "' || theButton || '"');
    htp.paragraph;
    htp.print('Here is the text parameter: "' || theText || '"');

    htp.print('Now what?');


    htp.bodyClose;
    htp.htmlClose;
end;
/
show errors

