/    Sign up×
Community /Pin to ProfileBookmark

Hidden DIV tag problem

Hello Everybody,

I have a little problem with my DIV tags.

I have this tag in my form…

<DIV id=”DateEndjs” STYLE=”VISIBILITY:hidden;”></DIV>

And this is done onSubmit of the form:

if(document.getElementById(‘DateEnd’).value == ”){
document.getElementById(‘DateEndjs’).innerHTML = “<span class=”TextNormalError”>This field must not be left blank.</span>”;
document.all[‘DateEndjs’].style.visibility = “visible”;
}else{
document.getElementById(‘DateEndjs’).innerHTML = ”;
document.all[‘DateEndjs’].style.visibility = “hidden”;
}

When I first submit the page and don’t fill in the field, it dynamically appears the error, that is good, but when I fill it in, it just hides it, but doesn do it dynamically=there is a blank line, you can’t just see the error, but you can see the space for it.

Can anyone help me with this? Also how can I make it, to check, when I put my cursor out of the textbox? I would like to do it that way rather than wait to push submut buttn

Thank you all,

Mike

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@karibaauthorJan 23.2003 — Thank you, Dave.

Mike
×

Success!

Help @kariba spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...