Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Make fmbadhandler repopulate name and email fields | Simple How-to

  1. #1
    Join Date
    Jan 2008
    Posts
    29

    Default Make fmbadhandler repopulate name and email fields | Simple How-to

    Make fmbadhandler repopulate name and email fields*

    When the return link is clicked on the error page, the following entries and changes in the HTML form will make fmbadhandler repopulate the name and email fields of the form, as it now repopulates the message field only:

    1. Add the line below to the HTML form, as is:
    <input type="hidden" name="derive_fields" value="email=Email,realname=Name" />

    (EDIT:The unnecessary reference has been edited out of the above line according to Russel's input in the next post, and the code works perfectly.)

    2. Add the line below to the HTML form, as is, to prevent receiving emails with its content appearing twice:
    <input type="hidden" name="mail_options" value="exclude=email;realname" />

    3. Find the following line in the HTML form, and replace the word realname with Name, as shown:
    <input type="text" name="Name" />

    4. Find the following line in the HTML form, and replace the word email with Email, as shown:
    <input type="text" name="Email" />


    The content of the emails you'll receive will appear as follows:

    Name: Name of sender
    Email: eMail address of sender
    mesg: Sender's message.

    * Although I got this to work perfectly, I really can't write code; I simply followed directions from the links listed below.
    If those of you who can write code see how this code should be changed and/or improved, please post the changes?

    http://www.tectite.com/fmdoc/creating_forms.php

    http://www.tectite.com/vbforums/show...realname+email
    Last edited by Jeremy; 15-May-2008 at 06:16 AM.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Hi,

    Thanks for your simple HOW-TO....I'll copy it to the HOW TO forum.

    Regarding:
    (I added imgverify as without it for some reason it lost its required status)
    I can't see how that would happen. The "required" or "conditions" fields in your form are untouched by FMBadHandler.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Aug 2007
    Posts
    78

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Thanks for this information! I ran into this issue recently and your HOWTO worked perfectly! Peace...

  4. #4
    Join Date
    Jan 2008
    Posts
    29

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Thanks for letting me know it was useful to you.

  5. #5
    Join Date
    Feb 2007
    Posts
    5

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Hi:
    The line below, do you have to do this with all the fields you want to repopulate when the user returns to the form?

    <input type="hidden" name="derive_fields" value="email=Email,realname=Name" />

    I am not using realname. I am using firstname, lastname, email, email2 (to verify email), phone, message.

    The same thing with this line:
    <input type="hidden" name="mail_options" value="exclude=email;realname" />

    do i exclude all my fields that I mentioned above?

    Thanks for your help.

  6. #6
    Join Date
    Feb 2007
    Posts
    5

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    I tried playing with the code, and do I put the code in my contactus.html form, or my template for fmbadhandler? When I hit my retun_link there is nothing repopulated in the fields, and my exclude email still sends the email and realname.

    Thanks

  7. #7
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    The code is put in your form, not a template.

    The line below, do you have to do this with all the fields you want to repopulate when the user returns to the form?

    <input type="hidden" name="derive_fields" value="email=Email,realname=Name" />
    No, just those 2 "special fields".

    I am not using realname. I am using firstname, lastname, email, email2 (to verify email), phone, message.
    If you're not using realname, then you don't need to derive that field. The firstname and lastname fields should automatically be filled in when you return to the form. You will need to derive the email field, renaming your field "Email" instead of "email", then exclude it from being listed twice by using the exclude statement in your mail_settings tag:

    HTML Code:
    <input type="hidden" name="mail_options" value="exclude=email" />
    do i exclude all my fields that I mentioned above?
    No, you only exclude the fields that you've renamed (derived), so that they're not listed twice in the email you receive. email and realname are special fields that are expected by the script. That's why those 2 field names are automatically listed in the email that the recipient gets.

    If your form isn't refilling the form fields when using fmbadhandler, then you probably don't have $TARGET_URLS specified, or you didn't specify the url for "this_form" in that hidden field.

    If you read the pages on Advanced Error Handling and "Derive Fields" in the Tectite documentation, you'll have a better grasp of what you need to do.

    ginger

  8. #8
    Join Date
    Oct 2008
    Posts
    9

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Hi,

    I found this thread to be very helpful.
    Just one thing the line;
    Code:
    <input type="hidden" name="mail_options" value="exclude=email;realname" />
    For me this needs to be;
    Code:
    <input type="hidden" name="mail_options" value="Exclude=email;realname" />
    Capitol E in Exclude or else I recieve an error and the fields still appear on the submitted email.

    I'm not the person to say why I just found this makes it work for me.

    Cheers.

  9. #9
    Join Date
    Feb 2009
    Location
    St.Albans, UK
    Posts
    9

    Post Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Firstly, thanks for making such a superlative product available; the level of support for FormMail and the scope for customisation far exceed any other free form mailers I have looked at.

    I am however left a little puzzled by this issue. I understand that 'realname' and 'email' are treated as 'special values' by the PHP scripts (although I am uncertain why this is so); but not why they get 'lost' when the user is returned to the form. Rather than requiring the proposed work-around, which I did try but threw up one or two quirks, is there no scope for modifying the PHP of fmbadhandler to pass them back in a similar fashion to other values?

  10. #10
    Join Date
    May 2008
    Posts
    1,291

    Default Re: Make fmbadhandler repopulate name and email fields | Simple How-to

    Quote Originally Posted by NorthPole View Post
    I understand that 'realname' and 'email' are treated as 'special values' by the PHP scripts (although I am uncertain why this is so);
    realname and email are special fields that are used by the script for the "header" of the email.

    Quote Originally Posted by NorthPole View Post
    Rather than requiring the proposed work-around, which I did try but threw up one or two quirks
    I've not seen any quirks that you refer to. What exactly is happening?

    ginger

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. simple formmail
    By gwbosma in forum Community Support
    Replies: 1
    Last Post: 20-Apr-2006, 09:22 PM
  2. Need directions to make a questionnaire form
    By amythepoet in forum Community Support
    Replies: 1
    Last Post: 08-Feb-2006, 02:34 PM
  3. Some fields not remembered using fmbadhandler
    By penta5 in forum FormMail Subscription Support
    Replies: 1
    Last Post: 12-Oct-2005, 10:35 PM
  4. HTML Email does not work if not all fields are filled.
    By onlmega in forum FormMail Subscription Support
    Replies: 7
    Last Post: 03-Aug-2004, 11:02 PM
  5. Deriving fields from other fields
    By russellr in forum HOWTO Guides and Tips
    Replies: 0
    Last Post: 13-May-2004, 12:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •