/    Sign up×
Community /Pin to ProfileBookmark

[ask] handling form visibility in javascript

hi guys, would u mind to help me??
I have two functions to show a kind of pop up form and close another one.
both form comes from an object named “window” and “e_window”.
herewith the code:

function displayForm()
{


e_window.hide();
window.show();
}

function displayEditForm()
{


window.close();
e_window.show();
}

then I have 2 buttons which handle those functions:
“add” => to close the edit form then shows the add form
“edit” => to close the add form then shows the edit form

when I click the “add” button followed by “edit”, it goes well.

the problem is:
when I click back the “add” button, the “edit” form was succesfully hidden but the “add” form doesn’t appear.

I just thought to put some “if” statement to check whether the form that should be close is being visible or not.
is that make sense?

I need your opinion guys.
thx before for your help.
?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangDec 06.2010 — Have you followed the guidelines for opening windows?

Why 2 forms? The forms a basically the same.
×

Success!

Help @coolbear91 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.20,
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,
)...