Here is my code in JavaScript and I want to create innerhtml button that will fill some hidden fields in my html form and I have problem maybe with the quotes, when I try to fill the AirportsForm.kod variable…
function EditTableCell(a)
{
var Myp= document.getElementById(a);
var nam=Myp.textContent;
var kod=Myp.id;
alert(kod);
var newHTML='<p id="'+a+'"><input size="35" type="text" name="edit'+a+'" id="edit'+a+'" value="'+nam+'" /><input type="button" value="Change" onclick="document.AirportsForm.kod.value='+"'a'"+'.value;document.AirportsForm.promena.value=document.AirportsForm.edit'+a+'.value;document.AirportsForm.submit();"/></p>';
}
here is the html: Its in the form AirportsForm
<input type="hidden" name="promena" id="promena" value="" />
<input type="hidden" name="kod" id="kod" value="" />
And in Php, I do $variable=$_POST["kod"] and for other hidden element.
Here i finished it for you and this way works, because u get an htmlObject element or input element here you should do it object.id or value or whatever u want to get and than use it later…
function EditTableCell(a)
{