08-01-2015, 07:11 PM
This is something I did a long time ago with PrototypeJS; its a bit clunky, and its just a show hide, so a view-source or inspect-element will show all the stuff, but its nice for candy.
Situation: You have a select box and you want that on newthread when option 1 is selected a certain text shows, on option2, another text shows.
Solution: You need to set up your custom field correctly and add a script to your new thread.
Custom field settings
Title : Give it a title
Key: Give it a key (keep it simple, it just makes the typing shorter in the script bits ). For this example I will call it contus_select
Input Field Type : listbox
Input Formatter
Values List:
Input Field HTML :
In your newthread template
Add the HTML for the two areas you want to have show on the select change.
Situation: You have a select box and you want that on newthread when option 1 is selected a certain text shows, on option2, another text shows.
Solution: You need to set up your custom field correctly and add a script to your new thread.
Custom field settings
Title : Give it a title
Key: Give it a key (keep it simple, it just makes the typing shorter in the script bits ). For this example I will call it contus_select
Input Field Type : listbox
Input Formatter
Code:
|
Values List:
Code:
|
Using the numbers like that makes it a lot easier to access the value in your js and its good to do it that way anyway for other reasons.
Input Field HTML :
Code:
|
Save the custom thread field.
In your newthread template
Add the HTML for the two areas you want to have show on the select change.
Code:
|
at the bottom of the template, right before the </body> tag
Code:
|
Ta-da ?