Forum Stats

  • 3,839,632 Users
  • 2,262,517 Discussions
  • 7,901,022 Comments

Discussions

how can i enable a button to trigger a pl/sql insert action on click in an apex pl/sql dynamic conte

User_G4ALZ
User_G4ALZ Member Posts: 6 Green Ribbon

i have this form i made with htp.p('');

htp.p('
<form>
<select multiple width="100%" style="width: 100%; height: 80%;">   
  ');
for a in 
(select id_plan, year_plan from plan)
loop
  htp.p('
<option value="'||htf.escape_sc(a.id_plan)||'">'||htf.escape_sc(a.year_plan)||'</option> 
end loop;
htp.p('</select>
<input type="submit" value="Submit">
</form>
');

i want to execute a pl/sql insert or update action when the form button is clicked.

is that possible ?

if so how?

Tagged:

Best Answers

Answers

  • Awais Majeed
    Awais Majeed Member Posts: 111 Bronze Badge

    you can call JavaScript function to enable / disable button in htp.p code like

    htp.p('function disp_alert()');
    


    Regards

    Awais Majeed

  • User_G4ALZ
    User_G4ALZ Member Posts: 6 Green Ribbon

    thank you sir for the explanation.

    my problem is that i have a very long list which is divided into groups, multiple level of groups (parent, sub_parent, sub_sub_parent..., child, sub_child) . i wanted to do so with the <optgroup> html tag but now since it is not possible i'm gonna have to work with 'select list' type of item in apex with only one parent group unless someone has another solution

  • jariola
    jariola Member Posts: 10,831 Gold Crown

    @fac586 , link you provided to apex.world give session state violation error.

  • User_G4ALZ
    User_G4ALZ Member Posts: 6 Green Ribbon

    thanks again for your explanation i will look into that.

    and since you asked for more explanation i could probably simplify my problem like this:

    is there a way to make a collapsible list: you open the upper title to find different objects, you open one of those objects to find more objects (tree structure) until you reach the last selectable object which you can then check or uncheck (a multi select list is required).

    i am new to APEX that's why i tried to find an html/javascript/plsql solution, if you know how i'd be very thankful and if not then i will just stick to your original solution with multiple select list .