Adding one more param on FC Text field

More
11 years 10 months ago #33145 by brandonking
Hello,

I need auto-complete address by zip code in item editing form. I have found that I only need to include one js file(add it in my main template) and add js function into input field in item editing form.
It would be very useful if I could add JS function(or any value) in input tag. We could even add html elements as well. Definitely, this is gonna make a FC field as powerful customization-able field.
e.g. like below.
<input id="custom_field122_0" name="custom[field122][]" class="inputbox required" type="text" size="30" value="" required="required" aria-required="true" aria-invalid="false" onKeyUp="AjaxZip3.zip2addr(this,'','val01','val01');">
So please consider adding one more param for this to work.
I could add one more param myself(I don't like doing this) or alternative way would be duplicating text field and add js function in input field manually. But I guess this is not gonna be the best solution for everyone. :D

Hope this will be accepted and implemented for coming version.
Best wishes,
Brandon

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

More
11 years 10 months ago #33146 by micker
hello
the best way
1 create a new plugin field like this flexicontent.org/documentation/f ... -type.html
2 integreate your js
3 share for community
!! ;)

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
11 years 10 months ago #33151 by brandonking
Hello,

I have tested by adding some code in original text.php and text.xml and works fine.

I have located below code in xml file.
Code:
<field name="extratag" type="text" default="" label="FLEXI_FIELD_EXTRA_TEXT" description="FLEXI_FIELD_EXTRA_TEXT_DESC" />

In text.php file, I have changed code from
Code:
<input id="'.$elementid.'_'.$n.'" name="'.$fieldname.'" class="inputbox'.$required.'" type="text" size="'.$size.'" value="'.$value.'"'.$required.' />
to
Code:
<input id="'.$elementid.'_'.$n.'" name="'.$fieldname.'" class="inputbox'.$required.'" type="text" size="'.$size.'" value="'.$value.'"'.$required.' '.$extratag.' />

Now we can insert extra html element or js function into Input tag.

Regards,
Brandon

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

More
11 years 10 months ago #33193 by ggppdk
Yes,

we could easily add this parameter, i will have it next commit

NOTE we will be adding custom validation masks via an external js library to the text field to have it behave in user friendly way for entering various data


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
11 years 10 months ago #33199 by ggppdk
Hello,
Added this one,
(to add custom HTML tag parameters to the input form field of the FC text field)
e.g.
onclick="..." onkeypress="..."

just take care not to break HTML of input with it,

you see inexperienced users could break HTML of the form with it and then report bugs.


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
11 years 10 months ago #33201 by brandonking
You are right. I am sure you did but just to remind that better to add examples in description to avoid breaking HTML.
Thank you very much! :D

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.452 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline