Ok, I detail it to you:
1)
The error you report is:
document.tablo_client.ident is not an object
Now: does $ident = $val["Id_client"]: return a string which is exactly
"ident" - do not confuse $ident with "ident": $ident is a variable name,
"ident" a value which has to be assigned to the name of the input field.
That is
if $ident = $val["Id_client"]:
then
$val["Id_client"] MUST return String: "ident"
THEN:
2)
you say:
input type="text" disabled NAME="<? $ident; ?>"
AND you say:
a href='javascript
:EnablerInput(<? $ident; ?>);
this cannot be: IF $ident returns "ident" as I do hope (!!), you're sayng
this:
name="ident"
AND
a href='javascript
:EnablerInput(ident)
that cannot work: ident is not in between quotes, so it is assumed as a
variable name which in your script is not defined.
perhaps you meant:
a href='javascript
:EnablerInput("\"<? $ident; ?>\"");
THEN:
3)
a href='javascript
:EnablerInput("\"<? $ident; ?>\"");
has no meaning, even as
a href='javascript
:EnablerInput(<? $ident; ?>);
IF the body of your function then says:
function EnablerInput(ident){document.tablo_client.ident.di sabled=false;}
In fact, if ident is a string it would turn into:
document.tablo_client."ident".disabled
which causes errors.
If ident is an object (which is not) it would return
document.tablo_client.SomeObject.disabled
which is not what you meant.
THUS: be sure the value you pass is a STRING, in between quotes, then
rearrange your code into:
document.tablo_client.[ident].disabled
thus you will exploiti the associative array capabilities of the object.
But foremost: are you sure $ident returns "ident", a STRING?
PS also, your php says:
while ($val = mysql_fetch_array($res))
{
$ident = $val["Id_client"]
/*no closing } bracket. Perhaps you omitted it but was in your original
code*/
ciao
Alberto Vallini
http://www.unitedscripters.com/
"guillaume" <pguillaume1@9online.fr> ha scritto nel messaggio
news:bnh7va$7pd$1@apollon.grec.isp.9tel.net...[color=blue]
> thanks for your help , i have changed id---> name but it doesn't work
> :-( bye
>
> "Vicomte De Valmont" <NOSPAM@hotmail.com> a écrit dans le message de news:
> bnh4cd$1dd$1@lacerta.tiscalinet.it...[color=green]
> > Hi
> >
> > well assuming that id="<? $ident; ?>" would relinquish as name ident[/color]
> (which[color=green]
> > I'm not sure, glancing quickly your php it seemed a variable which could
> > accept whatever value an user insert: $ident = $val["Id_client"]: it[/color][/color]
MUSt[color=blue][color=green]
> > relinquish "ident" if you want a command in JAVASCRIpt like
> > document.tablo_client.ident locate a NAME="ident" within a form whose[/color][/color]
name[color=blue][color=green]
> > on its own turn is "tablo_client") the main issue, or maybe just the[/color][/color]
most[color=blue][color=green]
> > apparent one seems: not id= but NAME=
> > Try that for now, then we'll see the rest.
> > ciao
> > Alberto
> >
http://www.unitedscripters.com/
> >
> >
> >
> >
> > "guillaume" <pguillaume1@9online.fr> ha scritto nel messaggio
> > news:bnh313$hc4$1@aphrodite.grec.isp.9tel.net...
> > 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[/color]
> update[color=green]
> > the name the link calls the javascript function "enablerInput()" to[/color]
> change[color=green]
> > the input's property from disabled to enable.
> >[/color]
>
> --------------------------------------------------------------------------
> --[color=green]
> > ----
> >
> > the HTML part is a table and i add rows with SQL query ... here is the[/color]
> code[color=green]
> > $query = "SELECT * FROM $table";
> >
> > $res = mysql_query($query);
> >
> > // tant qu'il y a des fiches
> >
> > while ($val = mysql_fetch_array($res))
> >
> > {
> >
> > $ident = $val["Id_client"]
> >
> > ?>
> >
> > <tr>
> >
> > <form name="tablo_client">
> >
> > <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="javascript
:supprimer(); id='<? echo $id; ?>'
> > ">supprimer</a></td>
> >
> > <td><a href='javascript
:EnablerInput(<? $ident; ?>);'>modifier</a></td>
> > //the link to call the function below
> >
> >
> > </tr>
> >
> >[/color]
>
> --------------------------------------------------------------------------
> --[color=green]
> > ----
> >
> >
> > the function is simple .... but doen't work
> >
> > function EnablerInput(ident)
> >
> > {
> >
> > document.tablo_client.ident.disabled=false; //[/color][/color]
error[color=blue][color=green]
> > message ; document.tablo_client.ident is not an object or is null
> >
> > }
> >
> > maybe should i create one form for each row ?
> >
> >
> >[/color]
>
>[/color]