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 
Making Changes To The Required Fields  XML
Forum Index » Support Forum
Author Message
Anonymous



Thought this might be useful to someone...

How to change the required fields in Advanced Guestbook.

If a user submits an entry to Advanced Guestbook and doesn't fill in the Name and Message fields then the entry is rejected and an error message displayed. You can change the fields that are required and the messages that are displayed.

Apologies if some of this is a bit basic, most of you guys on the forum are well advanced and sometimes the responses are too technical for a beginer like me , hopefully this explanation can be followed by all.

To change the required fields...

1 - Save copies of files before editing them. These changes worked for me, if they don't work for you at least you can go back to where you were. Files that get changes are: form.php in the templates subdirectory, add.class.php in the lib subdirectory and english.php in the lang sub-directory (or whatever language you're using).

2 - You need to delete the part of the script that checks to see if the field has been filled in.

3 - This example removes the requirement to fill in the Name field - the script for other fields is very similar (e.g. for comments it's gb_comment.value as opposed to gb_name.value and ErrorPost2 as opposed to ErrorPost1 etc).

4 - Open form.php from the templates sub-directory.

5 - Find the script in question. The script that requires the Name field to be filled in is this (lines 13 to 17)...


6 - Delete it.

7 - You can delete other parts of the script in order to remove the requirement to fill in other fields (the code to delete will be very similar except it will have a different ErrorPost number and different name).

8 - Once you're deleted what you don't want save the file.

9 - Open add.class.php from the lib sub-directory

10 - Find the script in question. The script that requires the Name field to be filled in is this (lines 189, 190 and part of 191)...

11 - Delete it (only the first 6 characters from line 191, after deleting line 191 should start...
12 - You can delete other parts of the script in order to remove the requirement to fill in other fields (the code to delete will be very similar except it will have a different ErrorPost number and different name).

13 - Once you're deleted what you don't want save the file.

To change the messages...

14 - If you've changed the required fields you might want to remove the asterisk that indicates required fields. Open form.php again and delete the asterisk where applicable (do a search for * and delete as required).

15 - If you've no longer got any required fields you may want to get rid of the bit that says The blanks with (*) represent required fields. If so, open english.php (or whatever language you're using) from the lang sub-directory and edit the message - in this case it's called FormMess1 and is on line 28.

16 - Whilst you're in form.php you can change your other messages.

That's it. Hope someone finds it useful.

Trevor
ricknlida
Beginner

Joined: 06/01/2004 21:07:20
Messages: 10
Location: columbus, oh
Offline

I found it VERY useful. Thank you.
Rick.

Rick
[Email] [WWW]
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Trevor wrote:
5 - Find the script in question. The script that requires the Name field to be filled in is this (lines 13 to 17)...


6 - Delete it.


Don't delete it!
Comment it out in case you want to put it back in.
When you comment it out it will look like this---



Auron

Visit my site @ www.ragnaru.com
Adv. Poll Install Guide NOW BACK ONLINE! (And also rather out of date I would of thought)
[Email] [WWW]
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum