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


Insert Record from hidden form element

Thread began 3/26/2015 3:45 pm by markhaynes75235 | Last modified 3/26/2015 6:54 pm by markhaynes75235 | 666 views | 2 replies |


Insert Record from hidden form element

Hi Ray and Jason:

I've got a website that's just about ready to go live, but I'm experiencing one little glitch in the contact form that I'm sure you can help me to sort out.

I'm using the MySQLi Insert Record Server Behavior on the contact.php page and all of the data from the non-hidden elements is being inserted properly in the database.

First I use the Insert Record to insert visitor data such as fullname, email, regDate and pgSrc (the last two are the date as defined by
<?php echo(date("Y-m-d H:i:s")); ?> and a page source number (integer) that tell me which page the user was on when they submitted the form.
Currently this SB is working fine. It's purpose is mainly to set a session variable for the visitorID which is then inserted into the second Insert record SB which inserts the visitorID session, fullname, email, phone, subject and message into the messages table. This SB is not inserting the regDate and pgSrc (page source number).

I'm using an AJAX Contact form/script as the source for my data which is on a mega menu. The form posts to the contact.php where the insert record server behaviors appear with some other scripts that validate the form and configure the email to be sent to various parties. a jQuery script is called from the containing page which animates the loading of the confirmation in the menu.

When I submit the form, the AJAX loads the confirmation script from the contact.php and the email is sent, the data is inserted (except for the two hidden element's data) and I get this notification:

Notice: Undefined index: visitorID in <path>/contact.php on line 26

Notice: Undefined index: regDate in <path>/contact.php on line 57

Notice: Undefined index: pgSrc in <path>/contact.php on line 58

I'm not sure why I'm getting these as the visitorID is getting set in the database and the SB checks to see if the value isset from the $_POST.

I've attached the three files that make this work. Any pointers will help as always!


Sign in to reply to this post


Insert Record from hidden form element

More information is included in the private message section

Sign in to reply to this post


Insert Record from hidden form element

Update: I was able to use var_dump(); to identify that the array was not getting those values set in the jquery.jigowatt.js, so I re-did the array:

$.post(action, {
name: $('#name').val(),
email: $('#email').val(),
phone: $('#phone').val(),
subject: $('#subject').val(),
comments: $('#comments').val(),
pgSrc: $('#pgSrc').val(),
regDate: $('#regDate').val(),
verify: $('#verify').val()

For some reason my syntax in that array was not correct. Once I corrected the syntax, everything worked.

Sometimes I just have to post to you guys to break my mind out of a logjam and get things working! ;~}

Meanwhile I REALLY wish I could have used Universal Email for this.


Sign in to reply to this post

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





Ease of use


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...