Keyword

auto complete extra fields

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 3 months ago #114841 by stavroch
auto complete extra fields was created by stavroch
I have 2 fields
1st field has Shop names
2nd field has addresses.

I woule like when I choose from the first field the name of the shop will auto complete the 2nd field the addresses.

Can I do this?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #114842 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: auto complete extra fields
Hello stavros,

One simple way to achieve this is by adding a simple JS script which changes the value of the second input.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 3 months ago #114843 by stavroch
Replied by stavroch on topic Re: auto complete extra fields
Can you help me more please?

It will be the same for me if I had a list of addresses of each shop, so when the admin will choose the shop name 1 the addresses will be completed to the field 2.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago #114844 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: auto complete extra fields
If you are accustomed to jQuery these two functions and tutorial will get you going.

api.jquery.com/change/
api.jquery.com/val/

Setup an extrafield as a select box and a text extra field (address).

Then in your scipt use the on change() function for the select box, check it's value ( val() ) and set the appropriate value to the text extrafield using JavaScript's if else or switch statements.

You can add this code to your K2.js (must backup in order to update but a lot easier) or develop a simple K2 Plugin to serve that .js file

More Links:
www.w3schools.com/js/js_if_else.asp
www.w3schools.com/js/js_switch.asp

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 3 months ago #114845 by stavroch
Replied by stavroch on topic Re: auto complete extra fields
Thank you Krikor for your support, but I am looking something like the api.jquery.com/change/ but on select option i would like to type something different as the user has coose.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 3 months ago - 11 years 3 months ago #114846 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: auto complete extra fields
Yes exacty you can use the
api.jquery.com/on/			

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 3 months ago - 11 years 3 months ago #114847 by stavroch
Replied by stavroch on topic Re: auto complete extra fields
Can you help me more please?
I have the files - newweb.gr/list/ - but I don't know how to display ingredients and how the "food" will be drop down in k2 extra field. The ingredients also I would like to be in text field.

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

  • stavroch
  • stavroch's Avatar Topic Author
  • Offline
  • Elite Member
More
11 years 1 month ago #114848 by stavroch
Replied by stavroch on topic Re: auto complete extra fields
Any news from the above?
I have already install a demo joomla account for testing.

Please let me know if you are interested to get this project.

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


Powered by Kunena Forum