close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Populating a form field from a recordset

Thread began 9/17/2009 1:32 pm by troyd | Last modified 9/19/2009 11:40 pm by troyd | 3030 views | 6 replies



Thanks again for the help.
After changing the colon to a semicolon I was still getting an error. So I pulled out my PHP books and started studying. I'm not sure, but I ended up getting it to work by removing the " that was in front of the $_Get on the second line. Please let me know if I should have done something different.

With your help though, I learned that this piece of code is a "Logical Oporator". Is that correct? It basically says that "if" this "whatever" excisists, do this thing. Or "else" do this other thing. In this case it was a generic value variable that would be = to "whatever" was being passed to the contact.php page. If there was no "whatever", then just go on and let the form function as normal.

THEN, in the form field "Subject", I put that reference at the end of the current validation value that FB had already inserted. It works great. Thanks.

One other question. I would like to pass more than one detail to that if statement. For example, ['productname'] and ['productnumber']. Right now, I just added a second echo to the href and it worked. I put a space between them to get a space to appear in the form. But it seems that it could be done a lot cleaner. How would you do it?

For reference, here is what I have so far.

On my contact.php page, as my link in the repeating tables I have;

<a href="contact.php?subject=<?php echo(urlencode($row_rsProducts['productname'])); ?> 

<?php echo(urlencode($row_rsProducts['productnumber'])); ?> ">
Inquire about this product</a>

On the Product List Page;

Your if else statement at the top of the page.


if ($_GET['subject']) {
$formsubject $_GET['subject'] ;
} else {
$formsubject "" ;


And then your field value; (which is after the validation)

<?php echo $formsubject?>

So that value for my "Subject" field, including the FB validation looks like this;

value="<?php echo((isset($_GET["invalid"])?ValidatedField("contact","fieldset_group_Subject"):"")); ?>

echo $formsubject?>"

If you don't mind, please let me know if this looks correct. I know it works because,... well it worked. But I also want to learn proper code so if you see anything I did wrong I would appreciate knowing. Thanks again for your help it was just what I was looking for.


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





Ease of use


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