Skip to Content Skip to Menu

Field Delimiters and Storing DB inside it???

12 years 5 months ago #200619 by marriage_minded_man
Field Delimiters and Storing DB inside it??? was created by marriage_minded_man
Ok. I would like to have my users do the following:

1. Select one selection from drop down list that is populated with many URLs (predefined by me).

and

2. Enter a 6 digit.



Each URL corresponds to a 4 digit id that I have (the user doesnt know this code).


I would then like to use field delimiter to output a code that consists of their 6 digit ID (which they entered manually), and the 4 digit ID that corresponds with the URL they selected. I need to have these 4 digit URL codes placed somewhere, somehow. How should I do this?


I don't know if this is a good idea but I was thinking this. Put a field delimiter named cb_masterurllist that says.

[cb:if cb_selectedurl="abc.com"]1234[/cb:if]
[cb:if cb_selectedurl="xyz.com"]4321[/cb:if]
.....


and so on to use this as my master list that has the URLs and their 4 digit codes.


I would then have another field delimiter that would spit out the code like this.



[cb:if cb_sixdigitid!=""]code code [cb_masterurllist] code code [cb_sixdigitid] code code[/cb:if]

So if their id is populated with the 6 digits, the code will display their 6 digits and the 4 digits that correspond with the URL they selected.

Will this work and is it a good idea to put the list of URLs and their corresponding digits into a field delimiter (how big can this list be and will it slow my server down?). Im thinking the list might be under 100 but would get bigger over time.

I hope I made sense.


I guess I can put an AND statement as well to say "if six digits are entered AND url is selected spit out the code" but I've just started to learn substitutions so I'm a little scared to mess it up. Help???

Please Log in or Create an account to join the conversation.

12 years 5 months ago #200621 by marriage_minded_man
Replied by marriage_minded_man on topic Re: Field Delimiters and Storing DB inside it???
or maybe the final code should be like this

[cb:if cb_sixdigitid!=""]code code [cb:userfield field="cb_masterurllist" /] code code [cb_sixdigitid] code code[/cb:if]

Since I want the output of cb_masterurllist?

Please advise whether I should proceed as mentioned in my first post.
Thanks.

Please Log in or Create an account to join the conversation.

12 years 5 months ago #200622 by marriage_minded_man
Replied by marriage_minded_man on topic Re: Field Delimiters and Storing DB inside it???
Why cant i just list the value of the selection right in the drop down field so that the value would be the 4 digit code and the displayed selection would be the URL? How can I do that in the dropdown field?

Please Log in or Create an account to join the conversation.

12 years 5 months ago #200623 by marriage_minded_man

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
12 years 5 months ago #200647 by krileon

Why cant i just list the value of the selection right in the drop down field so that the value would be the 4 digit code and the displayed selection would be the URL? How can I do that in the dropdown field?

You can, specify the digits as the values then translate the values as language strings. Example as follows

Values
1234
5678
9012

Translations
define( '1234', 'Value 1' );
define( '5678', 'Value 2' );
define( '9012', 'Value 3' );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

12 years 5 months ago #200686 by marriage_minded_man
Replied by marriage_minded_man on topic Re: Field Delimiters and Storing DB inside it???
Sorry, I'm still a little new. Can you give me a hint on the second part of that (translations). I assume you want me to open up a language file and put these strings in there.

Where do I put these strings? which file? And won't that effect the whole site, for example if someone puts in 4 identical digits on a separate field wont that spit out the URL value as the output based on the language file? I can live with it, i just need to know if its something I may have to deal with later.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum