Re: newbie:restricting users to change data in a textarea
| From: | Step Schwarz | Date: | Tue, 25 Mar 2003 20:04:34 +0000 |
| Subject: | Re: newbie:restricting users to change data in a textarea | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141000@lists.php.net to get a copy of this message | ||
Hi Mirco,
Try adding either "readonly" or "disabled" to the textarea tag:
> print "<textarea name=variable readonly rows=1
>
> cols=10>".stripslashes($row['variable'])."</textarea><br>";
Hope this helps, -Step
[...]
> There is one field that I whant to stop them from changing. This field I also
> use in my sql query when updating the table,ie. where variable='$variable'. So
> what I did was simply this:
>
> "<tr>\n";
> print "\t<td>$variable</td>\n";
> print "</tr>\n";
>
> instead of:
>
> print "<textarea name=variable rows=1
>
> cols=10>".stripslashes($row['variable'])."</textarea><br>";
>
> This definately stopped them from editing it but also disabled the mysql
> query from working. Can anyone just give me a couple of ideas how I can make
> this work.
>
> Thanks
> Mirco