close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update form Not updating

Thread began 3/29/2011 7:36 pm by dave315749 | Last modified 4/04/2011 11:59 am by Jason Byrnes | 2793 views | 7 replies |

dave315749

Update form Not updating

In a previous form it was discussed that you could have the update recordset run automaticly by submitting the form on page load. This works great in the browser but not in a CRON JOB.

How would i have this form automaticly submit using something other than javascript? from my reseach it looks like php and curl? Can you give me a direction to look to or what to do ?

1. Page works great when browsing to that page it loads and then submits.
2. page does not work when using a cron job, it does not submit the form.

Cron command is : /usr/bin/curl script.php



previous post i was talking about:

use javascript to submit the form on page load. edit the body tag to:
<body onLoad="document.form1.submit();">


and use the currant page submit trigger.



Also the reason why i have to do this is because the multiple record update code has to be at the top of the page. (so i have to submit the form) It does not work ( update on page load) if i put that code at the bottom of the page AFTER the repeat region.. Anything i am missing? or that code has to be at the top of the page?

Sign in to reply to this post

Jason ByrnesWebAssist

this page talks about using cURL to submit a form post in a cron job:
setting-up-a-cron-job-to-update-you-website-using-curl


the reason that using the before page load trigger does not work in the update is that the form post does not exist on page load, the form post does not exist untill the form is posted.

Sign in to reply to this post

dave315749

I do understand that, but

1. why does the code not work if i pull the on page load insert into database code and paste it at the bottom of the page, where it will load AFTER the form has been loaded.?
2. Any way to modify the code so this would work?

Sign in to reply to this post

Jason ByrnesWebAssist

using the onpage load trigger wont work because the form has not posted yest.

the insert behavior is expecting to get data from the form post.

moving the insert to be after the form does not mean that the form has been posted.

to do this in a cron job, you cant rely on the post data.


where are the form elements getting the values?

A recordset?

if this is the case, create a single insert behavior that uses the recordset values, and add a loop so it will loop through the recordsset instead of using the form.

Sign in to reply to this post

dave315749

Ok kinda following you, if i move the insert to be after the form and then post to that page using the cronjob that may work?

What do you mean by " to do this in a cron job, you can rely on the post data."

The elements are getting their values from the repeated form fields.. not the recordset itsself. I have heard of a look, but don tknow how at the moment, would it work with the form or would i need to do the recordset?

thanks again for your help, love the extensions!

Sign in to reply to this post

Jason ByrnesWebAssist

no, putting it after the form will have no effect, the form is still not posted


Where are the form elements getting their values, that is the question.


you wont be able to user the post for this, you will need to use a diferant way to get the values to the insert.


the problem is that the cron job just loads the page into the servers memory, not into a web browser.

the servers memory has no way of processing javascript the same way a web browser would.

you cant rely on the form post because the form is never going to post.

Sign in to reply to this post

dave315749

Ok, how about if i use the web assist insert code, and insert comes from the records set NOT THE FORM, i could put this inside of the repeat region and then it would loop and insert on each repeated result and set the trigger to page load.. would this insert a single record for each time it loads ?

Sign in to reply to this post

Jason ByrnesWebAssist

if you put the insert in the repeat region, it will insert a record for each result returned in the recordset each time the page loads.

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