stblink VIP
Total posts: 501
05 Jun 2013 08:54

I have a select field (it's a telephone country prefix) that has country names in it.

ex:

spain

portugal

france

Is there any way that, at template level i can insert 00351 instead of portugal, insert 0034 instead of spain?

thanks

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
05 Jun 2013 09:31

I do not think so. Even if you use SQL source for fields and it will save 00351 but anyway will always show Portugal


stblink VIP
Total posts: 501
05 Jun 2013 10:49

But it's possible to replace by an image correct?


Sergey
Total posts: 13,748
05 Jun 2013 11:08

But it's possible to replace by an image correct?

Pardon? What image? Are we talking about select field here?


stblink VIP
Total posts: 501
05 Jun 2013 11:16

Hmmm sorry, i see it's not possible unless using php code to find out what value is inside the field...

I was thinking something like:

find what value is inside select...

if value ="portugal" then

fields_keys_by_id[12];?>

if value ="spain" then

fields_keys_by_id[12];?>

this is possible at template level but using custom php code, am i correct?


Sergey
Total posts: 13,748
06 Jun 2013 01:56

You code is not clear to me what you try to do.

  1. Can you place anything inside IMG tag? Is that valid HTML syntax? I though IMG is self-closing tag.

  2. You just get the key of the field? But it will create the same key because in both cases you have the same field id.

I think you can create images like

path/country_spain.png

path/country_italy.png

And then in the code

fields_keys_by_id[12]; ?>


stblink VIP
Total posts: 501
06 Jun 2013 08:34

Thanks, that's about what i wanted to accomplish.

Powered by Cobalt