0

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_"/>
</select>
</div>

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?

1 Answer 1

0

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

So:

<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>
</div>
4
  • 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, 2018 at 19:50
  • see my edits. Using inputs for buttons
    – Mike
    May 16, 2018 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, 2018 at 5:35
  • depends on how you are trying to connect with the webpart in question.
    – Mike
    May 16, 2018 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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