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

Setting the default value of the form field to be a recordset entry AND the validated entry on an UPDATE form.

Thread began 4/24/2015 4:40 am by Nathon Jones Web Design | Last modified 4/29/2015 11:52 am by Ray Borduin | 571 views | 5 replies |

Nathon Jones Web Design

Setting the default value of the form field to be a recordset entry AND the validated entry on an UPDATE form.

I have an UPDATE form that takes values from a recordset to populate the default values for each form field. However, if a user completes the form, submits, and the validation fails I'd like the default value to be the validated entries just submitted.

So, at the moment, the value is:
value="<?php echo($rsEDITNEWS->getColumnVal("njstitle")); ?>"

And in the INSERT form the value is:
value="<?php echo(ValidatedField("addnews_166","formTITLE")) ?>"

Is there a way to combine the two so that it first displays the recordset value but then, on submit and validation, the validated entry?

Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

I'd add a url parameter to the failed redirect for the Server Validations.. so that if the validations fail it goes to your page like: addnews.php?valid=false

Then you can look for that url parameter when determining what value to default like this:

value=""<?php echo(isset($_GET['valid'])?ValidatedField("addnews_166","formTITLE"):$rsEDITNEWS->getColumnVal("njstitle")) ?>

Sign in to reply to this post

Nathon Jones Web Design

Bug...

Just created the Edit News page and when you insert a second Validation Show If, it wipes the first Validation Show If and jumps the code for that up into the head section! Check Line 43 of the attached.

This was happening with my Add News form too.

There is clearly a bug here which I hope you can sort for future releases. For now, as this is a time sensitive project, I'll need to manually repair it which removes the usefulness (point) of the extension entirely. So frustrating. :(

Sign in to reply to this post

Nathon Jones Web Design

Originally Said By: Ray Borduin
  I'd add a url parameter to the failed redirect for the Server Validations.. so that if the validations fail it goes to your page like: addnews.php?valid=false

Then you can look for that url parameter when determining what value to default like this:

value=""<?php echo(isset($_GET['valid')?ValidatedField("addnews_166","formTITLE"):$rsEDITNEWS->getColumnVal("njstitle")) ?>  



Syntax error with that:

<input name="formTITLE" type="text" autofocus required class="form-control" id="formTITLE" placeholder="Please enter your name..." value="<?php echo(isset($_GET['valid')?ValidatedField("editnews_302","formTITLE"):$rsEDITNEWS->getColumnVal("njstitle")) ?>" size="20" maxlength="100">

Fix...

This...
<?php echo(isset($_GET['valid')?ValidatedField("editnews_302","formTITLE"):$rsEDITNEWS->getColumnVal("njstitle")) ?>

Should be...
<?php echo(isset($_GET['valid'])?ValidatedField("editnews_302","formTITLE"):$rsEDITNEWS->getColumnVal("njstitle")) ?>

Will try that on the site and report back.

Sign in to reply to this post

Nathon Jones Web Design

That works, but I have an HTML Editor field whose initial value is defined as:

$CKEditor_initialValue = "".($rsEDITNEWS->getColumnVal("njtext")) ."";

How do I edit this so that it incorporates what I'm trying to do above? To display the recordset field default value initially but then the validated form value upon submit & failure of the validation?

Thank you Ray. Is Jason on holiday?
NJ

Sign in to reply to this post

Ray BorduinWebAssist

The same exact syntax:

php:
$CKEditor_initialValue = "".(isset($_GET['valid'])?ValidatedField("editnews_302","your_editor_field_name_goes_here"):$rsEDITNEWS->getColumnVal("njtext"))  ."";
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...