Update form with pre-populated fields from MySQL


Registered User
4 posts

I wanted to pre populate the fields with data from a subscribers database. Then the subscriber can change or leave the fields as they wish.
The form is then submitted to a page that updates the MySQL table.
I do this on many sites by manually creating the forms.
Is there any way Web Form Builder can do this?
Paul Axford CEO
Comsec Networks Inc.


Registered User
4 posts

OK - no problem:
I simply added 'value' property to all form fields with php echo from the DB data (in various ways such as "checked=checked" etc.)
Then altered the form action to point to my Update code.
Cheers,
Paul Axford CEO
Comsec Networks Inc.


Ambassador
1,611 posts

See! We sure do help you people even if it is by esp. It is all due to the Coffee we drink.:cool:
The Guy from OZ



Ambassador
1,611 posts

Wait a minute, Just to clarify, You use WFB to create a form that outputs to MySQL or do you manually create the forms to do this. Either works. But repopulating a form can not be done back into a WFB form.
I have looked at ways to do this but too many changes have to be made, At this stage it is a one way device.

One of my methods is to create the form in WFB (Nice) output to a script then if necessary create a page with a screen grab of the form. I insert the form using a position absolute tag and insert form elements into position the same way, precisely populated. ie The copy looks as good as the original I use a copy of the submit button. I would add a comment about why the user was sent to the created form.

and then post to the next action. Much easier than total manual creation.

Hmm! neccesity is the mother of invention ;)
The Guy from OZ



Registered User
1 post

Pablo,
You've done exactly what I need to do, but you are obviously better with PHP than I am.
Any chance that you could publish some sample code, maybe just for one or two fields, so that I can see the basic methodology of how it canbe done?

I'm happy to "play" with the code to suit my application but I just need a starting point.

Ta


Registered User
10 posts

Pablo,
DITO
You've done exactly what I need to do, but you are obviously better with PHP than I am.
Any chance that you could publish some sample code, maybe just for one or two fields, so that I can see the basic methodology of how it canbe done?

Thanks
Chris


Senior Advisor
13,540 posts
Online Now

Pre populating a form can be done but it all depends on what you want to show and the biggest thing is how to determine what values to show. If it's a users values then your going to need a php login script first so you can have the users login. After they login you now know who they are so you can display the values that pertain to them. Google php login scripts. There's several available.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

Here's my S-Drive site with
examples of what can be accomplished in VSD.
http://progrower.coffeecup.com/
Here's my CoffeeCup SCCP Shop with examples of what can be done.
http://progrower.coffeecup.com/shop/
This is a site I built for use in my job.
http://pestlogbook.com


Registered User
10 posts

I am using Opencrypt so I have all the variables ready to be entered into the value strings - sorry I am talking to you on two threads now.

Thanks
Chris

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.