/    Sign up×
Community /Pin to ProfileBookmark

Hey all, does anyone see an issue with this code? It seems to work sometimes just fine, and others the update element will show for no reason but the other two work. It is simply hiding three form elements when the page loads, but if the edit.gif image is clicked, the form elements are shown. Thanks!

[CODE]

<img src=’edit.gif’
onload=”
document.getElementById(‘sep’).style.display=’none’;
document.getElementById(‘team’).style.display=’none’;
document.getElementById(‘update_team’).style.display=’none’;”

onclick=”
var sty=document.getElementById(‘sep’).style; sty.display=(sty.display==’none’)?’inline’:’none’;
var sty2=document.getElementById(‘team’).style; sty2.display=(sty2.display==’none’)?’inline’:’none’;
var sty3=document.getElementById(‘update_team’).style; sty3.display=(sty3.display==’none’)?’inline’:’none’;
” >

[/CODE]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@dreams4000authorJul 12.2005 — if it helps at all, the update_team element that is not showing is a submit button. I have this same script elsewhere in the program and it seems to work just fine for the most part. IEs error when this does break, states Object Reqired. The form element is always there. Sometimes when it refreshes it works, other times it does not. It just seems that at times one of the elements acts quirky and will show for no reason when it is not supposed to. hope there are some ideas out there.. thanks all for the help
Copy linkTweet thisAlerts:
@felgallJul 12.2005 — Your code probably wont work with most browsers because only the window as a whole has an onload event in most browsers.
Copy linkTweet thisAlerts:
@dreams4000authorJul 12.2005 — I have not figured out yet why it is doing this, but a very similar code bit in other areas works just fine, just diff var names. I tried changing these, but that had no change. btw, this works in both IE and Firefox which are the two I am concerned with, just not this particular code segment for some reason. Any other ideas? thanks!
×

Success!

Help @dreams4000 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.10,
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,
)...