If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Please, dont' beat: Little Problem with a required field  XML
Forum Index » Advanced Guestbook Forum
Author Message
Andrea
Beginner

Joined: 02/11/2009 20:08:38
Messages: 7
Location: Germany, Munich
Offline

Hi all (and Carbonize),

Me again:

I have used the FAQ and the 'Search' and I could find, how to change the Email-Field into a required field. So far so good. It works almost fine.

But I couldn't find something about this: The Error page is opening up instead of a pop up (like the Name-error).

This I have added in form.php:

function checkForm() {
document.book.gb_email.value=trim(document.book.gb_email.value);
document.book.gb_comment.value=trim(document.book.gb_comment.value);
if(document.book.gb_email.value == "") {
alert("$LANG[ErrorPost12]");
document.book.gb_email.focus();
return false;
}

Could someone explain a Newbie in detail, what I should do?

Thank you so much for your help.

Andrea
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

I assume you want to do a complete job? If so we will need to edit both the form.php javascript and the entry checking in add.class.php.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Andrea
Beginner

Joined: 02/11/2009 20:08:38
Messages: 7
Location: Germany, Munich
Offline

Thank you so much for your reply, Carbonize.
I know, I'm too pedantic, but it don't look great having different pages for the specific errors.

I have tried to change in add.class.php, but something goes wrong.

Could you explain me, where and what I need to edit?

Thanks a lot.
Carbonize
Master
[Avatar]

Joined: 12/06/2003 19:26:08
Messages: 4292
Location: Bristol, UK
Offline

Well for a start try this instead

function checkForm() {
document.book.gb_email.value=trim(document.book.gb_email.value);
document.book.gb_comment.value=trim(document.book.gb_comment.value)
document.book.gb_email.value=trim(document.book.gb_email.value);
if(document.book.gb_email.value == "") {
alert("You must provide your email address!");
document.book.gb_email.focus();
return false;
}

Try that and see if that works then hit me back to start on the add.class.php


Either that or try Lazarus.

Carbonize
I am not the maker of the Advanced Guestbook

get Lazarus
[Email] [WWW] [Yahoo!] aim icon [MSN] [ICQ]
Andrea
Beginner

Joined: 02/11/2009 20:08:38
Messages: 7
Location: Germany, Munich
Offline

Thanks for your help.
I have tried, but it doesn't work. Ok, I am a Newbie and it's too complicate for me changing all these things.

Now I think about Lazarus.
 
Forum Index » Advanced Guestbook Forum
Go to:   
Based on the open source JForum