2016-04-26 19 views
0

Webツールキットを使用してToadのPL/SQLを使用して、aからのデータを送信しようとしています。これは私が期待される方法を動作していないようですToadでPL/SQLを使用してHTMLフォームを送信するにはどうすればよいですか?

 procedure submit_newcar(
      p_make  varchar2 default null, 
      p_model  varchar2 default null, 
      p_year varchar2 default null, --Year produced 
      p_engine  varchar2 default null, --Engine type 
      p_seats  varchar2 default null --Number of seats 
      ) IS 
     begin 
      INSERT INTO JOHN_TABLE_CAR 
      (ID, MAKE, MODEL, YEAR, ENGINE, SEATS) 
      VALUES 
      (null, p_make, p_model, p_year, p_engine, p_seats); 
     exception 
      when others then 
       htp.p('Error: '||TO_CHAR(SQLCODE)||'-'||SQLERRM); 
       write_log ('john_package.submit_newcar', to_char(SQLCODE)||'-'||SQLERRM); 
     end submit_newcar; 

:私は

procedure add_car is 
     begin 
      htp.title('August Vehicle Directory'); 
      htp.bodyopen; 
      Htp.tableopen('border=1 align=center'); 
        --Header: 
        HTP.tablerowopen; 
         htp.tabledata(style('Add New Vehicle','#t_1'),'center', ccolspan => '5'); 
        HTP.tablerowclose; 
        htp.tablerowopen; 
         htp.tabledata(style('Please add a vehicle to the database by filling out the forum below.','#t_msg'),'center',ccolspan=>'11'); 
        htp.tablerowclose; 

        -- Text-box entry: 
        htp.tablerowopen; 
         HTP.P('<td>'); 
          htp.tableopen(); 
          -- 
           htp.formopen('john_package.submit_newcar','post'); 
            htp.tablerowopen; 
            htp.tabledata(style('Make: ','#t_b'),'center'); 
            htp.tabledata('<input type="text" name="make_box" size="20" maxlength="30" value="">'); 
            htp.tabledata('&nbsp'); 
            htp.tabledata(style('Model: ','#t_b'),'center'); 
            htp.tabledata('<input type="text" name="model_box" size="20" maxlength="30" value="">'); 
            htp.tabledata('&nbsp'); 
            htp.tabledata(style('Year: ','#t_b'),'center'); 
            htp.tabledata('<input type="text" name="year_box" size="20" maxlength="30" value="">'); 
            htp.tabledata('&nbsp'); 
            htp.tabledata(style('Engine: ','#t_b'),'center'); 
            htp.tabledata('<input type="text" name="engine_box" size="20" maxlength="30" value="">'); 
            htp.tabledata('&nbsp'); 
            htp.tabledata(style('Seats: ','#t_b'),'center'); 
            HTP.P('<td>'); 
             htp.formSelectOpen('seats_dropdown'); 
             htp.formSelectOption('1'); 
             htp.formSelectOption('2'); 
             htp.formSelectOption('3'); 
             htp.formSelectOption('4'); 
             htp.formSelectOption('5'); 
             htp.formSelectOption('6'); 
             htp.formSelectOption('7'); 
             htp.formSelectOption('8'); 
             htp.formSelectOption('9'); 
             htp.formSelectOption('10'); 
             htp.formSelectClose; 
            HTP.P('</TD>'); 
            htp.tablerowclose; 
           htp.formclose; 
           -- 
          htp.tableclose; 
         HTP.P('</TD>'); 
        htp.tablerowclose; 

        HTP.tablerowopen; 
         HTP.P('<td align =center colspan=2>'); 
         htp.tableopen(); 
           htp.tabledata(support.button(0,'p_Submit','Add Vehicle','onClick="return this.form"')); 
           htp.tabledata(support.button(0,'john_package.loadpage','Cancel', 1, null, null),'center'); 
           htp.tableclose; 
         HTP.P('</TD>');    
        HTP.tablerowclose; 

      htp.tableclose; 
      htp.bodyclose; 
     exception 
      when others then 
       htp.p('Error: '||TO_CHAR(SQLCODE)||'-'||SQLERRM); 
       write_log ('john_package.add_car', to_char(SQLCODE)||'-'||SQLERRM); 
     end add_car; 

次それから私は、上記送信されたフォームからのデータを挿入shuold手順を持っています。 「Add Vehicle」ボタンをクリックするたびに、「submit_newcar」プロシージャからの挿入が呼び出されていないように見えます。これを正しく動作させるにはどうすればいいですか?

答えて

0

質問に対する回答は圧倒的に簡単で、ページのソースHTMLを全体的に調べていました。基本的には、フォーム内に「Submit」を含めなかったので、Submitボタンの各クリックは何もしませんでした。

は、私は、これは私の問題を解決行う

   HTP.P('<td align =center colspan=2>'); 
        htp.tableopen(); 
          htp.tabledata(support.button(0,'p_Submit','Add Vehicle','onClick="return this.form"')); 
          htp.tabledata(support.button(0,'john_package.loadpage','Cancel', 1, null, null),'center'); 
        htp.tableclose; 
       HTP.P('</TD>'); 
-- /\ submit button is inside form close now! 
htp.formclose; 

近い形の内側に次のことを移動するために必要な問題を解決するには。

関連する問題