How to take the 2 value of an Dice and show?

Asked

Viewed 138 times

1

In my program I search the table data and add in a array v_patr and then I add this array in var w_a:

<html>
            <select multiple size="7" name="cb_Patr" style="width:300">
                <?
                $w_querybusca="SELECT * FROM public.sai_cad_patr_seri WHERE 
                                sai_cad_patr_seri.fk_seq_cara_peri = '$arr_w_param[17]'";     
                $w_queryresultado=f_class_conecta_bd($w_querybusca);            
                $w_indice = 0;
                while($w_registro = pg_fetch_object($w_queryresultado))
                {
                    print('<option value="'.$w_registro->tx_num_patr.'">'.trim($w_registro->tx_num_patr).'</option>'."\n");

                    print("<SCRIPT language=javascript>  
                               v_patr[$w_indice] = \"$w_registro->tx_num_patr,$w_registro->tx_num_seri\";
                           w_a = v_patr[$w_indice];
                           </SCRIPT>"); 

                    $w_indice++;
                }
                ?>
               </select>    

But I have a second search after. So I will reuse v_patr that was added in w_a to get element 1 of the array.

            <select multiple size="7" name="cb_Seri" style="width:300"> 
            <?
                for($i=0;$i<=$w_indice;$i++)
                {   

                    //print('<option value="'.$i.'">'._[$i].'</option>'."\n");
                }
                ?>
                </select>

But I don’t know how to take w_a elements that were created in a JS inside php and assign it to: print('<option value="'.$i.'">'.w_a[$i].'</option>'."\n");

1 answer

1

The variable must be transported from one language to another over a new request. Not only will it bother you to try to traffic this information about both languages, but this is the wrong way to do it.

Not to reinvent the wheel, I suggest you do the reading of this my answer that gives a summary of requests $.ajax - which is the solution to your problems.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.