<HEAD>
    <STYLE TYPE="text/css">
        .Red {background: red;}
        .Blue {background: blue;}
    </STYLE>
</HEAD>

<FORM Method=Post onSubmit="return validateForm(this)">
<INPUT Type=Text Class="Blue" Name="textField">
<INPUT Type=Submit>
</FORM>

<SCRIPT Language=VbScript>
Function validateForm(theForm)
    If theForm.textField.value = "" Then
        alert "There was an error with the form"
        theForm.textField.className = "Red"
        validateForm = False
    Else
        validateForm = True
    End If
End Function
</SCRIPT>

Hope this helps!

Scott.

----- Original Message -----
From: "Tyler Brown" <[EMAIL PROTECTED]>
To: "ActiveServerPages" <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 5:38 AM
Subject: writing attribute values to form elements


> Help?  All I want to do is target an explicit form element and assign a
> value to it's class attribute.
>
> i.e. in validating a form if an element fails, as part of the response
> process I want to do something like :
>
> set form.text1.class = 'altDisplay'
>
> Any pointers on manipulating the form on it's way back out?
>
>
> ---
> You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
> To unsubscribe send a blank email to
%%email.unsub%%
>


__________________________________________________

Do You Yahoo!?

Sign up for SBC Yahoo! Dial - First Month Free

http://sbc.yahoo.com


---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to