Update form with pre-populated fields from MySQL

Home » Forums » Web Form Builder » 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,478 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
Prism
A many faceted individual


Ambassador
1,478 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
Prism
A many faceted individual


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

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.