Currenty I am using checkboxes to select more than one value in a form. So when creating a new post I can select all the categories it falls into. But the cat list is getting longer and is becoming a bit unmanagable.
I like how wordpress adds tags to each post via ajax. Wordpress has a text input field with autocomplete, you just start typing and then if it's already there (in the db) then it'll show and get adding to a list dynamically. If it's not found in the list then it gets inserted on form submit.
How can I achieve this or similar so that I don't have to use x amount of checkboxes?
Check out this jQuery library. It works on multi selects instead of checkboxes, but the logic and result is exactly what you need.
http://harvesthq.github.io/chosen/
(not affiliated, I've just used it a few times)
One option would be to make use a library such as jquery-autocomplete
https://www.devbridge.com/sourcery/components/jquery-autocomplete/
This makes use of AJAX based functionality and will give you the ability to tweak it based on values stored in a database table. You can make a simple check function that, in the case the value can not be found, the user will have the option to simply press add and insert it into said library.
The rest is jsut a matter of styling and design.
Related
I have a page with multiple text fields and select lists with the list of values. What I want to do is defining a dynamic action on one of the select lists that display numbers and returns same numbers and according to the selected number, I want to create or duplicate another select list in an amount of selected number. Then, after the end-user finish his work, I want to be able to take the selected values of select lists that are created within the dynamic action within the on-submit process.
Example:
In short, I want to create a dynamic action that duplicates the instructor list as many as the selected number of the number of sections list. How can I accomplish this?
If I understood what you are saying, you'd rather switch to a tabular form (or interactive grid, depending on Apex version you use). Using it, you can "Add row" as many times as you want (which would be your "Number of sections") and use the same LoV (i.e. Select List) in every row.
As far as I know (which really isn't that much), Apex isn't capable of doing that "as is". Maybe you can accomplish it the way you want it using some other techniques (blindly guessing & mentioning: JavaScript, Ajax, jQuery or whatever you might need).
I have created a driven database drop down menu on my website. It sends the selected value by the user to the database to be checked and returns a specific item.
Everything works perfectly now but I'm trying to pre select the first value so that the user will have the first option as default and can add it to cart directly and they also can choose a different size. So far, I tried 'selected' inside the option in the drop down but it doesn't do anything but displays the value when the page loads.
One last thing to mention, I'm using Ajax function to submit selected value and return result from the database.
I can think of two ways for this.
When the page is requested, make a call to your DB in your server-side code to store that value beforehand.
Use javascript's onload event to select the value as a part of a client-side script. You can use this answer as reference.
I'm not quite sure exactly what to search for or where exactly to start, but I'm trying to see if it's possible to have a customized search box for multiple GET queries simply using jQuery, JS, HTML and CSS.
The user would first type in something which will prompt the red box to show (key) and it would autofill with a listed default given the first few characters they typed. Then upon pressing enter or tab, they would be allowed to fill in the answer gray box (value). Then after, they can either choose to submit or put in another key / value.
Is there a jQuery library that already has this implemented, and is this even possible? I thought about putting input boxes inside the input search box and using jQuery to hide and show them depending on what they type, but is that the best way?
I'd like to do this without comprehensive framework / library like Angular and React.
Thanks in advance!
You must handle it with one of JavaScript freamworks like Vue.js, React.js or Angular.js
Currently I am using Jquery Chosen Plugin in order to search the values written inside a search box and it works very well in case I want to search on the basis of the text written inside the option tag. i.e. as shown in the figure:
But what I want to achieve is search on the multiple basis i.e. on the basis of the text written inside the option tag as well as the data attributes of the option tag i.e.
For example in the above figure I may be able to search Debitors either by typing Debitors directly or by typing the data-phone's value i.e.0321-111111. I've searched the chosen plugin's documentation for the possibility to search on the basis of multiple values but, as much as I know, there wasn't any functionality provided by it.
Now what I'd like to ask is, Is there any jQuery plugin providing this multisearch functionality that you may know of?
Thanks.
Finally, I found Select2 Jquery plugin that allows the custom matcher for the searching. i.e. You can define whatever you want plugin's search to search.
I'm trying to essentially create a drop down menu tied to a field that allows me to search multiple sections of the back end of a site by choosing which section to search using the drop down.
What this will entail is assigning a variable to represent the input from the form and scripting to toggle between the different query strings that that variable will be used to complete.
At this point I'm basically just lost as to how to structure the javascript required to accomplish this.
Can I tie each query string to each option using an id and then create a function that runs when the form itself is submitted, constructing the needed query URL by combining the variable with the base URL included in the javascript?
Basically I need, say, the text dropdown selection to tell the page that it will be appending %query% to http://example.com/content/text/?q= when the form is submitted and letting the system handle the rest.
I would sincerely appreciate some input on how to structure the js/jquery to accomplish that. I know I need to tie the variable to the field and the URLs to be completed to the drop down based on ID but I'm not totally sure how.
Here are some jsFiddle examples of what you might want to do:
Pass the search term and dropdown select field in the query string to one page and have the page do something based on the choices. jsFiddle
Pass the search term to a page specified by the dropdown select field. jsFiddle
Pass the search term to a URL specified by the dropdown select field. jsFiddle
This is what I would do.
Have a eventhandler for onsubmit
In YourMehtod(){
1. get dropdown selection
2. get the URL and append query string
3.window.open(url,"_self")
}