close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

We've been using the MySQLi Server Behaviors to insert data from our Contact form on our website for sometime with no problems. Yesterday I added a checkbox to the form named "emailReceive" for our contacts to check if they wish to receive email comm

Thread began 2/26/2016 4:37 pm by markhaynes75235 | Last modified 3/01/2016 1:36 pm by Ray Borduin | 319 views | 4 replies |

markhaynes75235

We've been using the MySQLi Server Behaviors to insert data from our Contact form on our website for sometime with no problems. Yesterday I added a checkbox to the form named "emailReceive" for our contacts to check if they wish to receive email communicat

You can see the behavior by going to http://www.abilityconnectiontexas.org and clicking the "CONTACT US" link on the nav bar. Fill out and submit the form on the CONTACT US form that appears on the megamenu. Everything will behave as expected on the front end, but the checkbox data is not inserted on the database. I've attached a screenshot of the Column Bindings tab in the Server Behavior and a screenshot of the test results as they appear in PHPMySQLAdmin when browsing the table data. The code in the page related to this issue is shown below:

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$InsertQuery = new WA_MySQLi_Query($actdb);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "visitors";
$InsertQuery->bindColumn("firstname", "s", "".($rsContacts->getColumnVal("contactFirstName")) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("lastname", "s", "".($rsContacts->getColumnVal("contactLastName")) ."", "WA_DEFAULT");
$InsertQuery->bindColumn("fullname", "s", "".((isset($_POST["name"]))?$_POST["name"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("email", "s", "".((isset($_POST["email"]))?$_POST["email"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("emailReceive", "c", "".((isset($_POST["emailReceive"]))?$_POST["emailReceive"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("status", "i", "4", "WA_DEFAULT");
$InsertQuery->bindColumn("regDate", "t", "".((isset($_POST["regDate"]))?$_POST["regDate"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("sourceSiteID", "i", "".((isset($_POST["pgSrc"]))?$_POST["pgSrc"]:"") ."", "WA_DEFAULT");
$InsertQuery->bindColumn("sourceSiteName", "s", "".($rsContacts->getColumnVal("contactDeptName")) ."", "WA_DEFAULT");
$InsertQuery->saveInSession("visitorID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
?>

Thanks again for your help!

enthusiastically,
Mark

Sign in to reply to this post

Ray BorduinWebAssist

It looks like it would work to me. Can I get FTP access to debug?

Sign in to reply to this post

markhaynes75235

MySQLi Server Behaviors and checkbox data

Hi Ray - Hope you and yours are doing well. I've put the FTP info in the Private Message area. Please keep confidential and let me know if you need anything or have any questions.

Sign in to reply to this post

Ray BorduinWebAssist

Your page seems to be using some sort of jquery AJAX form submit... that code isn't including the checkbox in the form submission... so that is the source of the issue.

I'm not sure what the fix is because I'm not sure exactly which .js script it is doing it. Maybe search their forums for why a checkbox might be ignored in form submission.

Sign in to reply to this post

markhaynes75235

MySQLi Server Behaviors and checkbox data

Originally Said By: Ray Borduin
  Your page seems to be using some sort of jquery AJAX form submit... that code isn't including the checkbox in the form submission... so that is the source of the issue.

I'm not sure what the fix is because I'm not sure exactly which .js script it is doing it. Maybe search their forums for why a checkbox might be ignored in form submission.  



Thanks Ray! I had forgotton that the js collects the form data and passes it to the contact.php. You pointed me in the right direction and I've got the site working properly now. Funny how we think of all things Javascript as client side. In this case it is used to help the form submission load the content in the success menu area.

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

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