hello from france,
I want to edit a list of customers dynamically and
each row contains an input text with the name of customer and link to update the name the link calls the javascript function "enablerInput() " to change the input's property from disabled to enable.
--------------------------------------------------------------------------------
the HTML part is a table and i add rows with SQL query ... here is the code
$query = "SELECT * FROM $table";
$res = mysql_query($qu ery);
// tant qu'il y a des fiches
while ($val = mysql_fetch_arr ay($res))
{
$ident = $val["Id_client"]
?>
<tr>
<form name="tablo_cli ent">
<td><input type="text" disabled id="<? $ident; ?>" value='<? echo $val["nom"]; ?>'></td> //function EnablerInput() has to change the property disabled
<td align="center"> <a href="javascrip t:supprimer(); id='<? echo $id; ?>' ">supprimer </a></td>
<td><a href='javascrip t:EnablerInput( <? $ident; ?>);'>modifier </a></td> //the link to call the function below
</tr>
--------------------------------------------------------------------------------
the function is simple .... but doen't work
function EnablerInput(id ent)
{
document.tablo_ client.ident.di sabled=false; // error message ; document.tablo_ client.ident is not an object or is null
}
maybe should i create one form for each row ?
I want to edit a list of customers dynamically and
each row contains an input text with the name of customer and link to update the name the link calls the javascript function "enablerInput() " to change the input's property from disabled to enable.
--------------------------------------------------------------------------------
the HTML part is a table and i add rows with SQL query ... here is the code
$query = "SELECT * FROM $table";
$res = mysql_query($qu ery);
// tant qu'il y a des fiches
while ($val = mysql_fetch_arr ay($res))
{
$ident = $val["Id_client"]
?>
<tr>
<form name="tablo_cli ent">
<td><input type="text" disabled id="<? $ident; ?>" value='<? echo $val["nom"]; ?>'></td> //function EnablerInput() has to change the property disabled
<td align="center"> <a href="javascrip t:supprimer(); id='<? echo $id; ?>' ">supprimer </a></td>
<td><a href='javascrip t:EnablerInput( <? $ident; ?>);'>modifier </a></td> //the link to call the function below
</tr>
--------------------------------------------------------------------------------
the function is simple .... but doen't work
function EnablerInput(id ent)
{
document.tablo_ client.ident.di sabled=false; // error message ; document.tablo_ client.ident is not an object or is null
}
maybe should i create one form for each row ?
Comment