-1
Well, I pass the data of my fields via JS (their codes)!
Example in JS:
function f_veri_dados()
{
w_form="sai_frm_incl_novo_cara_peri1";
// Periferico do programa anterior
w_param = document.forms[w_form].w_cb_peri.value+"@";
// Marca
if(document.forms[w_form].nm_cb_fk_seq_marc.value == "0")
{
alert("Informe a Marca!!");
document.forms[w_form].nm_cb_fk_seq_marc.focus();
return false;
}
w_param = w_param + document.forms[w_form].nm_cb_fk_seq_marc.value+"@";
// Modelo
w_param = document.forms[w_form].nm_cb_fk_seq_mode.value+"@";
// Nota fiscal
if(document.forms[w_form].nm_cb_nota_fisc.value == "0")
{
alert("Informe a Nota Fiscal!!");
document.forms[w_form].nm_cb_nota_fisc.focus();
return false;
}
w_param = w_param + document.forms[w_form].nm_cb_nota_fisc.value+"@"
}
Within the HTML
I call the function f_veri_dados()
to get the data from the fields! But, I would like to pass also the text that the user "typed".
HTML:
<table border="0" width="100%">
<tr>
<td>
<input type="hidden" name="w_cb_peri" value="<?=$w_cb_peri;?>">
</td>
<td align="right" colspan="3" width="12%">
<font face="arial" color="blue" size="2">Marca :</font>
</td>
<td>
<?
$w_querybusca="select * from sai_tb_marc order by desc_marc;";
$w_queryresultado=f_class_conecta_bd($w_querybusca);
if (pg_num_rows($w_queryresultado) == 0)
{
print("<SCRIPT language=javascript> alert(\"Cadastre uma marca.\");
parent.location.replace(\"../sai_prin/sai_menu0.php\");</SCRIPT>");
}
print('<select name="nm_cb_fk_seq_marc" id="id_cb_fk_seq_marc" onchange="f_le_modelo(this.form.name);" style="font-size:11; color:Black; width:120">'."\n");
print('<option value="0"> Selecione</option>'."\n");
while($w_registro = pg_fetch_object($w_queryresultado))
{
print('<option value="'.$w_registro->seq_marc.'">'.trim($w_registro->desc_marc).'</option>'."\n");
}
print ("</select>");
?>
</td>
<td align="right" width="14%" >
<font face="arial" color="blue" size="2">Modelo :</font>
</td>
<td id="td_fk_seq_mode" colspan="3" width="20%">
<select name="nm_cb_fk_seq_mode" id="id_cb_fk_seq_mode" style="font-size:11; color:Black;" width="90">
<option id="opc_fk_seq_mode" value="0"> Selecione
</option>
</select>
</td>
<td align="right" width="29%">
<font face="arial" color="blue" size="-1">Nota Fiscal :</font>
</td>
<td align="left" width="17%">
<?
$w_querybusca="select * from sai_cad_nf order by num_nf;";
$w_queryresultado=f_class_conecta_bd($w_querybusca);
print('<select name="nm_cb_nota_fisc" style="font-size:11; color:Black; width:100">'."\n");
print('<option value="0"> Selecione</option>'."\n");
while($w_registro = pg_fetch_object($w_queryresultado))
{
print('<option value="'.$w_registro->seq_nf.'">'.trim($w_registro->num_nf).'</option>'."\n");
}
print ("</select>");
?>
</td>
</tr>
</table><br>
<table border="0" width="50%" align="center">
<tr>
<td width="50%">
<button type="button" style="width:65" onclick="f_veri_dados();"><img src="../sai_imag/novo-reg.ico">
</button>
</td>
</tr>
</table>
Let me explain further ... I want to pass the text of a combo
. That is, in this way that I’m doing it just takes the option code (in combo
) selected and I would like to pass the text (name) of it together!
You have to show your HTML to make the problem clearer
– Sergio
HTML post!!!!!
– Bruno
@Bruno, if solved, please accept the answer that solved your problem or create yourself the answer so that in the future this post helps another person.
– fernandosavio