Forum Moderators: open

Message Too Old, No Replies

document.write positioning

Position document.write in specific place

         

julep821

3:10 am on Jun 29, 2004 (gmt 0)

10+ Year Member



I have a form with a check box, that disables a text field and button onClick. I also want it to display text based on whether the box is clicked or not.

How do I do this using document.write in the function?

I currently have:

function clearDate()
{
//if (document.add_user.p_exempt_date.value="Y")
if (document.add_user.p_exempt_date.checked == true)
{
document.add_user.p_v_date.value = " ";
document.add_user.p_v_date.disabled = true;
document.add_user.getDate.disabled = true;
document.write("User is EXEMPT from date expiration");
}
else
{
document.add_user.p_v_date.disabled = false;
document.add_user.getDate.disabled = false;
document.write("User is NONEXEMPT from date expiration");
}

}

Which works, but it clears the whole screen. Ideally I need it to display the message over the checkbox.

Any ideas are appreciated.

Purple Martin

3:23 am on Jun 29, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Instead of document.write, you can use an object's .innerHTML property: use it to re-write the contents of an element that you've given a unique id (so you could enclose the text box in a span with an id, then re-write the contents of the span with a disabled checkbox).

julep821

5:50 pm on Jun 29, 2004 (gmt 0)

10+ Year Member



Thanks so much for the help, I got it :)