/    Sign up×
Community /Pin to ProfileBookmark

Webform inside of a toggle button

Hi all

I´ve got a question.

In my website i have got one webform inside of a toggle button. By default this toggle button is collapsed.

The problem is if there exist some error by submitting the form you won´t see the message “there exist some erros in your web form” because automatically the page will refresh and the toggle button will collapse.

There exist some way to solve this problem? Shocked

Please have a look on the below link:

[url]http://oceanicoresidenceclub.com/prestige_residence_club.html[/url]

Many thanks in advance

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@MTputer_comJun 01.2009 — Maybe I am blind, but I don't see any error code in your source code. What type of errors are you talking about? Is it something you can code to come up in an alert box? That would come up on top of everything even if the layer is hidden...

Jeff
Copy linkTweet thisAlerts:
@sjscostaauthorJun 01.2009 — If you submit the webform and don't fill any field you have a error message, but that message stay hide.... you need click once more on the button.

I want that if I have a error on the webform that the user see that message
Copy linkTweet thisAlerts:
@MTputer_comJun 01.2009 — This needs to go in between the <head> and </head>:

<script language="JavaScript" type="text/javascript">

<!--

function checkform ( form )

{

if (form.name.value == "") {

alert( "Please enter your first name." );

form.name.focus();

return false ;

}

if (form.phone.value == "") {

alert( "Please enter your phone number." );

form.phone.focus();

return false ;

}

if (form.email.value == "") {

alert( "Please enter your email address." );

form.email.focus();

return false ;

}

return true ;

}

//-->

</script>



YOUR FORM:

<FORM action="mailto:[email protected]" method="post" name="form" enctype="text/plain" onsubmit="return checkform(this);">


This should work.

Jeff
Copy linkTweet thisAlerts:
@MTputer_comJun 01.2009 — sorry, the first one should read "Please enter your name"
Copy linkTweet thisAlerts:
@sjscostaauthorJun 01.2009 — Thank you very mutch ?

I alredy test and work very well
Copy linkTweet thisAlerts:
@platoonJun 01.2009 — Thanks for your guide but i know it well already
Copy linkTweet thisAlerts:
@sjscostaauthorJun 02.2009 — Hi!!!!

I continue with a problem... ?

Your solution is good but in my webform I have captcha....

How I verify if that field is correct?

I think that when submit the button send a error value for a text field and after compare if field is null or not... but doesn't work... because at the moment that I submit this filed is empty, just after have a value if the form have error...

Please, You have a solution for my problem?
Copy linkTweet thisAlerts:
@DelanJun 02.2009 — I don't have time to help you now, but the error occurs before the new page loads, by the way. It is:

"escondetudo is not defined"

in this code:

escondetudo();
×

Success!

Help @sjscosta 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.5,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...