close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Update Record - bindings

Thread began 11/28/2012 5:24 am by thehalpeen319342 | Last modified 11/30/2012 6:44 am by Jason Byrnes | 1848 views | 14 replies |

thehalpeen319342

Update Record - bindings

Jason, am I going mad. This form I'm building has opened a can of worms. Just when I thought it was finished, more problems arise on testing - it's a marathon - I'm going daft.
Okay calm down!!!

Some background: Firstly I ran DataAssist Pages, just to see the code behind a CRUD system. As a result I have two questions.

1. How did you bind the Insert and Update page.

Update Page
The code used in email is <?php echo((isset($_GET["invalid"])?ValidatedField("usersupdate","UserEmail"):"".$row_WADAusers["UserEmail"]."")); ?>


Insert Page
The code used in userfirstname is <?php echo((isset($_GET["invalid"])?ValidatedField("usersinsert","UserFirstName"):"")); ?>



Where did this code come from - there is all sort of stuff in there - I've tried to bind using everything I can see on the bindings page - see my attached pdf - but nothing comes close to entering this robust code

It's driving me mad - almost!!!

Attached Files
bindings.pdf
Sign in to reply to this post

Jason ByrnesWebAssist

the biding code for the insert page is generated by the Validated Entries bindings. This will only be available if you use Server Validation to validate the page.

If you add Server Validation to validate the form on the insert page, a new binding group will be added to the bindings panel named Validated Entries, it is used to retain information in the form when validation fails.


the binding code on the update page is a modified version of the validated entries code.

on the update page, the server validation behavior is set to send a URL variable named invalid.


On initial load, the values from the WADAusers recordset are used to populate the form fields. If the form is submitted, and fails validation it uses the validated entries binding.

this is not code that will be generated by the bindings panel, it has to created manually

Sign in to reply to this post

thehalpeen319342

Okay Jason, I'm lost. I did the following:

I created a page called insert_test.php. I added a form with only one field 'first name'. I applied the WA Insert Record behaviour. I then created a WA Server Validation - a 'require' validation. This created a folder in the bindings panel called 'WA Validated Entries'. I dragged the only field in this folder over to the form field name 'first name' to bind it, and this is what appears in the field:
<?php echo(ValidatedField("inserttest_365","f_name")) ?>

It's a lot different than:
<?php echo((isset($_GET["invalid"])?ValidatedField("usersinsert","UserFirstName"):"")); ?>


The isset part seems to be missing. What am I doing that's incorrect?

Sign in to reply to this post

Jason ByrnesWebAssist

your not doing anything incorrectly.

the bindings panel does not generate the isset version of the code, if you want to use the isset version of the code:

1) set the failed redirect to pass the invalid url variable:
pagename.php?invalid=true

2) manually add the isset check
<?php echo((isset($_GET["invalid"])?ValidatedField("usersinsert","UserFirstName"):"" )); ?>

the isset check is a ternary expression, in other words a shorthand if stattement, in the form of:
question?if true:if false


in this case the question is:
(isset($_GET["invalid"])

the true part is:
ValidatedField("usersinsert","UserFirstName")

and the false part is:
""

or a blank string.

Sign in to reply to this post

thehalpeen319342

Jason, I think I'm getting out of my depth. So if I have say twenty fields, I have to manually add the 'isset' part at the beginning and a few commas, brackets at the end of each input field.


What is the difference between:
<?php echo(ValidatedField("inserttest_365","f_name")) ?>

and

<?php echo((isset($_GET["invalid"])?ValidatedField("usersinsert","UserFirstName"):"" )); ?>

Sign in to reply to this post

Jason ByrnesWebAssist

  What is the difference between:
<?php echo(ValidatedField("inserttest_365","f_name")) ?>

and

<?php echo((isset($_GET["invalid"])?ValidatedField("usersinsert","UserFirstName"):"" )); ?>  




there are lots of diferances, page name, field name etc..

to convert:
<?php echo(ValidatedField("inserttest_365","f_name")) ?>


would be:
<?php echo((isset($_GET["invalid"])?ValidatedField("inserttest_365","f_name"):"" )); ?>

Sign in to reply to this post

thehalpeen319342

Jason,
Am I correct in saying, that if I use CSS Form Builder, I don't have to worry about any of this coding/isset stuff on an insert page, because the CSS Form Builder takes care of it?

So the only thing is to deal with is the Update page. Does Form Builder write the code for the update?

Sign in to reply to this post

Jason ByrnesWebAssist

only the data assist wizard would create the code for you on the update page and insert page.

Sign in to reply to this post

thehalpeen319342

Ok, thanks

Sign in to reply to this post

thehalpeen319342

This post has been deleted.

loading

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