Page 1 of 1

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

Posted: Fri Nov 15, 2013 9:47 pm
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?

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

Posted: Sat Nov 16, 2013 12:16 pm
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

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

Posted: Sat Nov 16, 2013 6:26 pm
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!

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

Posted: Mon Nov 18, 2013 8:51 pm
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.

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

Posted: Tue Nov 19, 2013 5:46 am
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.

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

Posted: Wed Nov 20, 2013 10:23 pm
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. :-)

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

Posted: Wed Nov 20, 2013 11:16 pm
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

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

Posted: Thu Nov 21, 2013 12:33 am
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.