|
Posted by OmegaJunior on 01/01/07 16:49
On Mon, 01 Jan 2007 17:43:16 +0100, raj <raj@nospam.com> wrote:
> Hi,
>
> I'm a newbie needing help to fix imported text in a textarea i.e so th=
at =
> the
> imported text in the text area cannot be changed in the webbrowser. =
> Here's
> the code snippet:
>
> <p><textarea name=3D"textarea2" cols=3D"70" rows=3D"7" wrap=3D"virtual=
"><?php
> include("contracts/termsandconditions.txt"); ?></textarea></p> =
>
> Thank you in advance,
>
> Raj
>
Basically you're looking to disable the textarea element. Check out the =
=
"disabled" attribute in the html4 specification:
http://www.w3.org/TR/html401/interact/forms.html#adef-disabled
You'd use it like this:
<textarea disabled=3D"disabled" ...>
But that's only the first step. Although the text can't be edited in the=
=
page, there's nothing preventing a malevolent visitor from editing it =
elsewhere and submitting the changed text to the form handler.
Thus in your form handler you also must make sure not to include this =
textarea. If you need the text, include it in your form handler (a secon=
d =
time, since you already included it in the form) but don't read it from =
=
the textarea.
Hope this helps!
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Navigation:
[Reply to this message]
|