Update form with pre-populated fields...

User 2318756 Photo


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.
User 2318756 Photo


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.
User 464893 Photo


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


User 464893 Photo


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


User 520300 Photo


Registered User
2 posts

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

User 2212453 Photo


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
User 187934 Photo


Senior Advisor
20,181 posts

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.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 2212453 Photo


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.