/    Sign up×
Community /Pin to ProfileBookmark

Form error into window.open

Hi, I would like to ask you for help within my form.
I’m gathering all errors within my form by this way…

[QUOTE]

if (f.PhoneNumber.value==””){
error = error + “* Telefonn”;
fall=1;
}

if (f.Message.value==””){
error = error + “* Komentářn”;
fall=1;
}

[/QUOTE]

After that I call

[QUOTE]

if (fall==1){
window.alert(chyba);
return false;
}else {
return true;
}

[/QUOTE]

it works, but I would like to open new window instead of window.alert and put all error into it.

Any advice pls?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@BigMoosieSep 13.2005 — what exactly do you want to do?
Copy linkTweet thisAlerts:
@cz_patejlauthorSep 13.2005 — I would like to place error variable content into new window instead of window.alert
Copy linkTweet thisAlerts:
@BigMoosieSep 13.2005 — var hello=window.open();

hello.document.write("<HTML>...</HTML>");

hello.document.close();
Copy linkTweet thisAlerts:
@cz_patejlauthorSep 13.2005 — i see ?

ok, and how to transport error variable into <body> of new window?

it is enought to put there <body>error</body>?

or something like document.write?

best

p.
Copy linkTweet thisAlerts:
@BigMoosieSep 13.2005 — [B]hello.document.write("<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>"+error+"</BODY></HTML>");[/B]

You can add as much markup as you like.
×

Success!

Help @cz_patejl 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.22,
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,
)...