close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Including form validation with insert behavior

Thread began 1/20/2016 6:48 pm by dazler1977 | Last modified 1/21/2016 10:31 am by Ray Borduin | 446 views | 3 replies |

dazler1977

Including form validation with insert behavior

I have added my form validation but now I am trying to use the insert function. The validations are working but it is not inserting to the database. Am I missing something?

Sign in to reply to this post

Ray BorduinWebAssist

It looks like it should work... to debug I'd add this code after the ->execute() line:


var_dump($InsertQuery);
die();

That should:
1) tell you if it is getting into the IF statement and trying to do the insert at all
2) show you any errors that might be occurring

Sign in to reply to this post
Did this help? Tips are appreciated...

dazler1977

Including form validation with insert behavior

Hi Ray, I added that code that you suggested but there are no errors coming up. Any suggestions?
I have several pages that have forms that need validation/email/insert, so if I can get this page up and running then I can do the others.

Sign in to reply to this post

Ray BorduinWebAssist

Does anything show up? If not, then it isn't getting into you IF statement...

Maybe at the end add an else statement between the two close brackets so instead of:

}
}

use:

} else {

echo(empty($emailErr)?"":"has emailErr<br>");
echo(empty($workErr)?"":"has workErr<br>");
echo(empty($generalErr)?"":"has generalErr<br>");
echo(empty($projectnameErr)?"":"has projectnameErr<br>");
echo(empty($cityErr)?"":"has cityErr<br>");
echo(empty($stateErr)?"":"has stateErr<br>");
echo(empty($aboutprojectErr)?"":"has aboutprojectErr<br>");
echo(empty($projectdescrErr)?"":"has projectdescrErr<br>");
echo(empty($budgetErr)?"":"has budgetErr<br>");
echo(empty($durationErr)?"":"has durationErr<br>");
echo(empty($foundErr)?"":"has foundErr<br>");
echo(empty($salesrepErr)?"":"has salesrepErr<br>");

die("validation failed");
}
}

Our Data Bridge product has a very robust validation system that you could use rather than writing your own like you have. I would suggest using it in the future to make validation cleaner and easier to debug.

Sign in to reply to this post
Did this help? Tips are appreciated...

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