Posting related elements to the same...

User 2796854 Photo


Registered User
44 posts

Hello all!!

I have been trying to figure out how to map related elements to the same value in my datable table or to the same column in the CSV file. No luck and I am hoping you all can help.

Root cause of the issue: Hidden elements will still post to my table

I created an example of the problem in hopes it can help get my question across. It's attached.

Description of the problem:

So lets say I have Country as my first dropdown. Country Dropdown has 2 States: State 1 and State 2
State 1: Has 2 options- City 1 and City 2. City 1: has 2 Options: Street 1 and Street 2.
State 2: Has 2 options - City 1 and City 2. City 1: has 2 Options: Street 1 and Street 2.

The idea is to write the Value of State 1 or State 2 to satename value; but since each State 1 and State 2 have there own name they create 2 different values.

Same with City.

Instead of having countryvalue, statevalue, cityvalue in my table I have:
coutnryvalue, state1value,state value,state1city1value, state1city2value,state2city1value,state2city2value

A huge mess.

So how do I map the the sateXvalues to satevalue and all the cityXvalues to cityvalue?

Attachments:
User 187934 Photo


Senior Advisor
20,181 posts

Hi Tim,
If I'm following you want all the states names to be listed in the same column in your table?
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 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Hi Tim,
If I'm following you want all the states names to be listed in the same column in your table?


Correct.

Instead of having 2 state cols I'll have one. Instead of having four city cols, I'll have 1.
User 187934 Photo


Senior Advisor
20,181 posts

Are you able to alter this form after export?
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 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Are you able to alter this form after export?


Hi Eric. Yes. I can alter the related project files. Using BBEdit.


User 187934 Photo


Senior Advisor
20,181 posts

Do you know how to use dynamic drop downs? If not give this thread a look.
http://www.coffeecup.com/forums/web-for … post260375
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 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
Do you know how to use dynamic drop downs? If not give this thread a look.
http://www.coffeecup.com/forums/web-for … post260375



Have used the before - pretty new to the whole thing. But with the thread you gave me I should be able to start. I'll come back and let you know how it went. Thank you so so much.
User 2796854 Photo


Registered User
44 posts

Thinking about this more - I think the question is why does the form post hidden fields?

If I create a table with the required columns then one would think the form should only write the appropriate columns.

So in this example: all the StateX elements should write to the state column and all the CityX emlemnts should write to the same city column.

Is there a way to stop hidden elements/fields which would have a null value from trying to write to the database?

If I haven't admitted it yet, let me know, I am a total novice at this. trying and learning as fast as I can.
User 187934 Photo


Senior Advisor
20,181 posts

The form builder will only post values that are showing and not hidden by conditionals from within the formbuilder itself. If you hide inputs with your own css or jquery the formbuilder will post those because it doesn't know you have done this.
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 2796854 Photo


Registered User
44 posts

Eric Rohloff wrote:
The form builder will only post values that are showing and not hidden by conditionals from within the formbuilder itself. If you hide inputs with your own css or jquery the formbuilder will post those because it doesn't know you have done this.

Hi Eric,

I don't think I am explaining my confusion correctly:

The hidden values are still creating columns in my database. Instead of have a City1, City2, City3 Column because I have three City elements (1,2,3) I need all three to write to the same column City.

So City1 element maps to City column, City2 elements maps to City col and City3 elements maps to City Col.
The form will only show one at a time depending on the users earlier selection.

I've attached a screenshot of the database table.

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.