close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Complex form issue

Thread began 6/20/2011 2:49 pm by Brad Lawryk | Last modified 2/11/2012 12:45 pm by Brad Lawryk | 1552 views | 4 replies |

Brad Lawryk

Complex form issue

I have a form where when submitted needs to edit two tables and insert into another. I can get it to work, but the problem is that every time the form page is opened it runs the insert.

Is there a way to set two triggers to an insert? Like for example If the button is pushed AND the record doesn't exist?

Sign in to reply to this post

Jason ByrnesWebAssist

You cannot set two triggers for the insert through the wizard, you would need to modify the code after it is created to add the second condition to the trigger if statement.

for example the trigger code for any form post would look like this:
if($_SERVER["REQUEST_METHOD"] == "POST"){



to add a condition for the recordset being empty, change that to:

if($_SERVER["REQUEST_METHOD"] == "POST" && ($totalRows_RecordsetName == 0)){

Sign in to reply to this post

Brad Lawryk

Thanks, I will give that a try.

Perhaps I can add that as a future product feature in an upcoming release to have multiple triggers. That would rock!

Sign in to reply to this post

Brad Lawryk

That works great but is there a way to add a third trigger that checks if a value is greater than 24? I have:

if ($_SERVER["REQUEST_METHOD"] == "POST" && ($totalRows_rsCreditCheck == 0) && ($_POST['hours'] > 24))

But that doesn't seem to work.

Sign in to reply to this post

Brad Lawryk

AH! Got it!

if ($_SERVER["REQUEST_METHOD"] == "POST" && ($totalRows_rsCreditCheck == 0) && ((isset($_POST["hours"]))?$_POST["hours"]:"") > 24)

Works great!

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