Hi
I'm having a problem getting my php variable into the form, without that i can't create a new record since the database expect that value
My form is called when i press the "new" button
<div id="dlg" class="easyui-dialog" style="width:800px;height:500px;padding:10px 20px"
closed="true" buttons="#dlg-buttons">
<div class="ftitle">Nova Atividade</div>
<form id="fm" method="post" novalidate>
<div class="fitem">
<label>Cargo:</label>
<select name="cargo" id="cargo_name"></select>
</div>
<div class="fitem">
<label>Atividade:</label>
<input name="nome" required="true" class="easyui-textbox" size="60">
</div>
<div class="fitemdatahora">
<label>Data:</label>
<input name="data" class="easyui-datebox" id="data" size="30">
</div>
<div class="fitemdatahora">
<label>Hora:</label>
<input id="hora" class="easyui-timespinner" name="hora">
</div>
<div class="fitem">
<label>Local:</label>
<input name="local" class="easyui-textbox" required="true">
</div>
<div class="fitem">
<label>Intervenientes:</label>
<input name="inter" class="easyui-textbox" required="true">
</div>
<div class="fitem">
<label>Notas:</label>
<input name="notas" id="notas" size="60">
</div>
<div class="fitem">
<input type="text" name='iduser' id='iduser' value="<?php echo var_dump($userid); ?>">
</div>
</form>
</div>
<div id="dlg-buttons">
<a href="javascript:void(0)" class="easyui-linkbutton c6" iconCls="icon-ok" onclick="saveUser()" style="width:90px">Registar</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dlg').dialog('close')" style="width:90px">Cancelar</a>
This is where my php variable should be
<input type="text" name='iduser' id='iduser' value="<?php echo ($userid); ?>">
Outside the form, the variable is filled...so what's wrong? any help?
How do you call your form when pressing the 'new' button? Please show some code snippets to describe it.
Hi
Thanks for your reply
function novaAtividade(txt){
$('#dlg').dialog('open').dialog('setTitle','Registar Nova Atividade');
txt = <?php echo $userid; ?>;
return txt;
$('#fm').form('clear');
}
function update() {
var iduser = <?php echo $userid; ?>;
$("#userid").attr("value",iduser);
}
window.onload = update;
Now is working, i calling that function in my form
<form id="fm" method="post" action="javascript:update()" novalidate>