close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

email sends address form OK, copy recordset

Thread began 9/27/2013 10:59 am by Sweens | Last modified 9/28/2013 4:19 am by Sweens | 2103 views | 9 replies |

Sweens

email sends address form OK, copy recordset fails

I'm doing a simple contact form (used the automated process for this)

First step - user selects the subject. This takes the user to the next part (new form) where the ID of the subject is retrieved from the database, together with the destination address.

User completes the form - all that side of things works properly - but anything from the recordset doesn't get included;e.g. the message isn't sent to the bcc (destination email address from the recordset), the Email Subject isn't included.

When I bind these elements to hidden form field, everything works -but that isn't satisfactoy, as it shos th destination email address in the source code.

Must be something simple!
Chris

Sign in to reply to this post

Jason ByrnesWebAssist

you can edit the email template and add the hidden element to the Remove array.

see the following tutorial for details:
http://www.webassist.com/tutorials/Customize-form-elements-in-your-form-generated-emails

Sign in to reply to this post

Sweens

Hi Jason

Thanks for the response - but I just did the hidden field to test whether the recordset was present or not; the fact that it is doesn't explain why the emails aren't sent to the address from the recordset. I really want it to work this way, as I have lots of other forms that need to integrate with the database - as I see it, UE isn't working 'out of the box' like it should, so I need to know what to fix.

Sign in to reply to this post

Jason ByrnesWebAssist

well, to be fair, it's not UE that isnt working, it is the recordset.

So to tell why the recordset is not working, I would need a copy of the page.

the fact that the hidden element works means that the recordset is working on page load.

my bet is that you use a variable on page load to filter the recordset that does not exist when the form is submitted.

Remember that submitting a form reloads the page. so any variables that are used to filter the recordset need to exist when the page is loaded and again when the form is submitted.

Sign in to reply to this post

Sweens

Hi Jason

I've attached the page; not sure why an additional variable should be needed!

Cheers
Chris

Sign in to reply to this post

Jason ByrnesWebAssist

  not sure why an additional variable should be needed!  



You misunderstand, it's not that an additional variable is needed. It's that the variable that exists when the page loads needs to also exist when the form submits.

I see two recordsets on your page:
rsSubjects - uses the ClubID URL variable as a filter

rsEnq - uses the SubjID form element to filter.


I also see that there are 2 forms on this page, looks like the first form filters the rsEnq recordset, then you submit the second form.

This method will not work for you because of the way forms work.

The information form the first form will not be available when the second form submits.

Form data is only available to the action page while it is loading, once the actin page finishes loading, the form collection is deleted by the server.


You will need to do merge the 2 forms into one so that the SubjID form element is part of the form that sends the email.

you will also need to edit the action of the form:
action="<?php echo (htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)); ?>"

to:
action="<?php echo(htmlentities($_SERVER["PHP_SELF"], ENT_QUOTES)."?".$_SERVER["QUERY_STRING"]); ?>"


this is need so that the ClubID URL variable is passed when the form submits.

Sign in to reply to this post

Sweens

Thanks for the explanation, Jason - I wasn't aware of that - live and learn!

I will do it the way I had it previously - insert the message into a database table, retrieve the corresponding 'destination email' record from a different table, send the email and delete the message record. Probably convoluted, but it worked!
Thanks again.
Cheers
Chris

Sign in to reply to this post

Jason ByrnesWebAssist

another option would be to store the message and the destination in session variables, then use the session variables in the email and unset the sessions.

basically, your issue revolves around variable persistence, sessions have a longer life span then the get or post.

Sign in to reply to this post

Sweens

Good idea! That sounds much more straightforward - I will experiment.

Cheers
Chris

Sign in to reply to this post

Sweens

Hi Jason

Just to say I've got it working using a session variable - so much easier than the way I was trying to do it. Thanks again for the suggestion - always good to get other people's ideas and different ways of doing things.

No need to reply

Cheers
Chris

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...