AnsweredAssumed Answered

Values from dynamic Dropdown - how?

Question asked by boho on Feb 18, 2015
Latest reply on Apr 25, 2016 by johnv

Hi,

I need a dynamic dropdown (that works) but how can I get the value selected by the customer in the dynamic Dropdown?

This is my code in an detail_in.htmpl:

 

// this function creates the arrays with id and name and works (the where is here a sample)

function z_create_geb()    {

                //alert("in _create_geb");   

                <PDM_LIST ESC_STYLE=JS2 prefix=list_g factory=z_geb_sap where="delete_flag=0">

                               ret_g_name[ret_g_name.length] = decodeURIComponent('$list_g.z_g_name');

                               ret_g_id[ret_g_id.length]                 = decodeURIComponent('$list_g.id');

                </PDM_LIST>

                arr_g_anz = ret_g_id.length;                          

}

 

// this code creates the dynamic Dropdown and works also

 

<PDM_MACRO name=dtlStartRow>

detailRowHdr("Geb",1,0);

if (ret_g_id.length > 1) {   

                <PDM_MACRO name=dtlStartRow>

                docWriteln('<tr><td align="left">');

                docWriteln('<select' + detailNextID(true) + '>');

                for (i = 0; i < ret_g_id.length; i++) {

                               docWrite('<option value="' + ret_g_id[i] + '" ');

                               docWriteln('>' + ret_g_name[i] +'</option>');

                }             

                docWriteln('</select></td>');

}

 

How can I use the selected value ('ret_g_id' or 'ret_g_name')  and store it in the DB??

Regards

Outcomes