[SOLVED] Formbuilder field names - where/how are they set?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
teleute
Forum Members
Forum Members
Posts: 26
Joined: Tue Jan 13, 2009 7:03 am

[SOLVED] Formbuilder field names - where/how are they set?

Post by teleute »

When I create a form in formbuilder and then look at the source, I can see all of the fields have names that are different from the names I've given them in formbuilder - with a large prefix of seemingly random characters, then __<sequential number>. Is there a way to change these to more descriptive names? If not, how is this prefix generated? Also, I've noticed it's changed between when the form was first created and now - what would cause that change? (I'm guessing it may have happened when I added a new field, but I don't understand why that would cause all of the other names to completely change...)

Thank you!

ETA: Okay, the initial 6 characters I thought was "random" looks like it's a form id. That's the part that changed. What would trigger a change in form id?
Last edited by teleute on Wed Nov 20, 2013 10:53 pm, edited 2 times in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3304
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Formbuilder field ids - where/how are they set?

Post by velden »

Latest formbuilder (0.7.4) has some 'errors' http://dev.cmsmadesimple.org/bug/view/9557

Wait for next release or downgrade to 0.7.3
teleute
Forum Members
Forum Members
Posts: 26
Joined: Tue Jan 13, 2009 7:03 am

Re: Formbuilder field ids - where/how are they set?

Post by teleute »

Is there anywhere with more information on this bug? I'm not 100% sure I understand the implications of the change. Thank you!
teleute
Forum Members
Forum Members
Posts: 26
Joined: Tue Jan 13, 2009 7:03 am

Re: [SOLVED] Formbuilder field ids - where/how are they set?

Post by teleute »

So after some testing, I was able to discover that the IDs seem tied to the form alias. Anytime I change the form alias, that 6-character form ID changes. Interestingly, if I change it back to something it was previously, the ID goes back to what it was previously as well, so either that pair is stored in a db for history somewhere, or the ID is some sort of hash of the name.

Further tests confirmed that modifying individual fields on the form did not cause this ID to change, which is good.

I still wish that you could actually name form fields, as opposed to relying on the system-generated strings, but at least I know more or less how they're generated and what will cause them to change, which is the important thing.
king_cucaracha
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 10, 2010 5:35 pm

Re: [SOLVED] Formbuilder field ids - where/how are they set?

Post by king_cucaracha »

Actually in previous versions of FB, AS I REMEMBER you could choose either byID number assigned by the system: easy for automatic templating, but troubles came if you migrated server cuz thise field_ids were different for every installation (as far as i could understand were seralized)
Or you could choose by Field Alias (usually automatic generated after sanitiziing field's name)

Haven't tried 0.7.4 but in older versions those were the ways, better stick to a previous version and give it a try.
teleute
Forum Members
Forum Members
Posts: 26
Joined: Tue Jan 13, 2009 7:03 am

Re: [SOLVED] Formbuilder field ids - where/how are they set?

Post by teleute »

king_cucaracha wrote:Actually in previous versions of FB, AS I REMEMBER you could choose either byID number assigned by the system: easy for automatic templating, but troubles came if you migrated server cuz thise field_ids were different for every installation (as far as i could understand were seralized)
Or you could choose by Field Alias (usually automatic generated after sanitiziing field's name)

Haven't tried 0.7.4 but in older versions those were the ways, better stick to a previous version and give it a try.
Ah - wait. I was using incorrect terminology in my original post. I've corrected it. I can use the option under the advanced settings of each field to change the field *id* (which is what I'd originally been asking about, incorrectly) - but what I actually need is the field *name*. As far as I can tell, this cannot be changed from the system-generated values. However, the thing about them being generated from the form ID, and that changing when the form alias is changed - those observations are all still valid. :-)
king_cucaracha
Forum Members
Forum Members
Posts: 27
Joined: Fri Dec 10, 2010 5:35 pm

Re: [SOLVED] Formbuilder field names - where/how are they se

Post by king_cucaracha »

If by "the source" you mean the rendered html code. It is assigned by the module templating.

Why do you need to change field properties in rendered html??
Are you looking for make changes or validating using javascript or jquery?
If that is what you intend, you can make those changes in the form display template.

Could you be more specific about what are you trying to do?
Cant answer from fri22 to wed27 since I'm going out the office, but if you post before/during thursday I can try to help you.
Regards
teleute
Forum Members
Forum Members
Posts: 26
Joined: Tue Jan 13, 2009 7:03 am

Re: [SOLVED] Formbuilder field names - where/how are they se

Post by teleute »

I have an external, standalone .NET app that is using an HttpWebRequest to submit data to us through the form on our website. (Nothing shady, without the user's knowledge! :-) It's basically a diagnostics thing that helps them gather the right data to send.)

For readability of the .NET code as well as future proofing (I was quite alarmed when the field names changed, which is what prompted this post!), I'd like to send the data via human-readable field names rather than g3826dfbrp__127 or whatever.
Post Reply

Return to “Modules/Add-Ons”