Button search
-
I would like to make a button for execution of sql ,,, for example. Button named “ drama “. Then after click button then , query the table which contain drama in specific column ..
The page I need help with: [log in to see the link]
-
Hi @kenusys,
If you are using the Data Publisher, you can add a search form in front of your table. This type of filtering is explained here:
https://wpdataaccess.com/docs/data-publisher/search-form/
This works for Data Projects as well.If you want to access a database table yourself with PHP, you can use the Code Manager. Here is a code example:
https://code-manager.com/code/?wpda_search_column_code_name=Execute%query%rom%PHP%shortcodeIs this what you are looking for?
Thanks,
PeterI could not write php code , in the search form i would like put key word using maxbutton …. Can you help me , maybe put the something at buttons advanced field
Then it will worksHere is our search form http://www.3gg.kr/movie/
AndHi @kenusys,
You are getting a cors error. Please check this image: https://ibb.co/KLrk5s1
That errors needs to be fixed first! Can you arrange that?
Thanks,
PeterPeter ,
I can not fix this error , even i do not know where error comes.
I just put button that search form 3gg.kr/movie/ ..I am not familiar code manager i think your search publication page is so good enough only i would like put button value to field is it possible ?
At button’s advanced feature … but there is not enough documentation …
Ken
Peter ,
Would you provide javascript which can be run when your push button “java script onclick event …. http://Www.3gg.kr/movie/ THERE IS SF BUTTON , WHICH CAN SORT OUT SF MOVIE AMONG THE WHOLE MOVIE LIST .
Ken
Hi Ken,
The table works for me now! I was on http instead of https. The http link does not work, but the https does.
Oke, let’s get your search form working. I don’t understand much of what I see on page table, but in the html i see there is a column movie_actor. Let’s take that one as an example.
You need to create a search page first and add a normal html form to it. To search on column movie_actor you need to add a text field to your search form with name:
wpda_search_column_movie_actorA text field name needs prefix wpda_search_column_ to make it searchable.
Then submit the form to: https://www.3gg.kr/movie/
Make sure to use GET. POST does not work (yet).When the user enters the name of an actor and pressed submit, the plugin will automatically pick up the value enter for movie_actor. You can add additional columns the same way. So to make column movie_director searchable, just add a text field to your search form with column name:
wpda_search_column_movie_directorPlease note that wildcards (%) do not work with the actual release. This is solved in the next update.
Does this help?
Best regards,
PeterHi Ken,
Did you get it work? Version 5.2.3 is now available and solves the wildcard issue. 😉
Best regards,
PeterPeter ,
I could not solved problem . moreover typing text in search form (field??)
We want using small snippet(javascript) to button passed value( genre like drama sf ) search form (field)
We do not know the id
i am not programmer ,,, i copied javascript code from internet as following
here is<form> /<input type="text" class="gc-header__search-input" name="s" placeholder="검색어 입력..." id="search" value="" /> <button onclick="myFunction()">sf </button> <script> function myFunction() { document.getElementById("search").setAttribute("value", "sf"); } </script>can you help me…
Hi Ken,
Are you aware of the search panes feature? Here is a demo:
https://wpdataaccess.com/search-panes-demo-without-buttons/This feature allows users to search specific values on mouse click. I need to mention that this features requires a premium license. Looks promising to me for your use case.
What do you think?
Thanks,
PeterPeter
thanks for help us …
I implemented search pane before ,, but customer don’t like ,,
because Our data is not fitted to search pane… w
there is more than 120 lines
first one is 1
second one is 1
third one is 1
fourth one is 82
fifth one is 1
sixth one is 1….. like this
we bought maxbutton plugin , we do not care maxbutton if Java script works,, also maxbutton manual is so so poor ,,, .
I want just one snippet (java script ) which can pass value to search field…
your search query is so powerful ,,, customer likeif you know java script (function ) … can you help me
Ken
another one is reserved word (collapse all , show all , clear all ) can be translated to korean word…
Hi Ken,
If you change the publication language to Korean, labels are translated automatically. This feature is documented here:
https://wpdataaccess.com/docs/data-publisher/change-publication-language/Regarding the buttons, can you create a few wireframes to explain how the search should work? I don’t mind writing some code for you. 😉
Thanks,
Peterhere is wireframe I think there is two way A,B
A. snippet not using maxbutton plugin snippet
1) using native HTML , make a button for SF (named and vaule )
2) if customer toggle SF button , then It’s value be passed to
search input filed
3) query disㅔㅣ묘 the movie only SF genreB. snippet using Maxbutton plugin
1) We put SF button on the page using Maxbutton plugin
2) if customer toggle SF button , then It’s value be passed to
search input filed ( Maxbutton has onclick feature for javascript )
3) query display the movie only SF genreHi Ken,
Here is some plain html for a search button. When the button is pressed the user is redirected to the page containing your publication shortcode and adds query:
genre=SF<form method="get" action="/your-page-containing-the-shortcode/"> <input type="hidden" name="wpda_search_column_genre" value="SF"/> <input type="submit" value="SCIENCE FICTION"/> </form>To adapt the html to your website:
– Replace /your-page-containing-the-shortcode/ with the correct page name
– Replace genre with the correct column name
– Replace SF with the correct column value
– Replace SCIENCE FICTION with your preferred column labelPlease let me know if this works for you,
PeterPeter, thanks for your great help .. your code dose not ,, looks like I have some error
instead of button ,, how about using selection list ,, I want return value of
function favGenre to search field.. Do you think it is possible or it is impossible
this snippet does not with main body???what is exact step of javascript ??????
— Javascript Snippet —
<script>
function favGenre() {
var mylist = document.getElementById(“myList”);
document.getElementById(“favourite”).value = mylist.options[mylist.selectedIndex].text;
}
</script><b> Select you favourite genre site using dropdown list </b>
<select id = “myList” onchange = “favGenre()” >
<option> —Choose Genre — </option>
<option> Drama </option>
<option> sf </option>
<option> war </option>
<option> romance </option>
</select>
<???? ????>
The topic ‘Button search’ is closed to new replies.