Today i use HTML-Form web part to connect to the list in question. I then use the following code to filter/sort:

<div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
<select name="filter">
<option value="">Pick one</option>
<option value="Department 1">Department 1</option>
<option value="Department 2">Department 2</option>
<option value="Department 3">Department 3</option>
<option value="Department 4">Department 4</option>
<input type="button" value="show" onclick="javascript:_SFSUBMIT_"/>

When users are filtering the lists, it requires 3 clicks from them. First, open the dropdown list, then select a value and finally, click on the "show"-button.

I want to reduce the number of clicks to one. by using buttons instead. It is possible? Or is the connection between web part and list the only way for this to work?


try the onclickevent for the <input> tag: https://www.w3schools.com/jsref/event_onchange.asp


<div onkeydown="javascript:if (event.keyCode == 13) _SFSUBMIT_">
<input value="Department 1" onclick='javascript:_SFSUBMIT_' type="button">Department 1</option>
<input value="Department 2" onclick='javascript:_SFSUBMIT_' type="button">Department 2</option>
<input value="Department 3" onclick='javascript:_SFSUBMIT_' type="button">Department 3</option>
<input value="Department 4" onclick='javascript:_SFSUBMIT_' type="button">Department 4</option>
  • Your solution reduced the number of clicks, but I want to get away from the dropdown. I belive buttons to be more user friendly.
    – Drycker
    May 15 '18 at 19:50
  • see my edits. Using inputs for buttons
    – Mike
    May 16 '18 at 1:01
  • That code does not work, I'll try to see if I can modify it and make it work. Thank you for taking the time
    – Drycker
    May 16 '18 at 5:35
  • depends on how you are trying to connect with the webpart in question.
    – Mike
    May 16 '18 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.