meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

JavaScript Autocomplete function support? #2379

Open jberanek opened 5 years ago

jberanek commented 5 years ago

Does MRBS support javascript autocomplete function on input text? Thanks.

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1676

jberanek commented 5 years ago

You mean the autocomplete attribute for <input type="text"> elements? MRBS doesn't use the autocomplete attribute, so by default it is 'on', so, yes, MRBS supports autocomplete.

Original comment by: campbell-m

jberanek commented 5 years ago

Hi Campbell, So could I customize the specific value of autocomplete for ?

Original comment by: *anonymous

jberanek commented 5 years ago

Yes, you could. I'm not quite sure what you want to achieve. Depending on what you want to do, another possibility could just be to make use of the existing capability in MRBS by using the $select_options or $datalist_options config settings which will turn your input into a select element or datalist element respectively.

Original comment by: campbell-m

jberanek commented 5 years ago

Hi Campbell, The $select_options could not resolve my whole requirement, if the option is not in the lists, I would like to allow users could enter their own text. So I would like to use autocomplete with customization values, just no idea how to add the codes into enit_entry.js to make the functions work, thanks.

Original comment by: *anonymous

jberanek commented 5 years ago

Well $datalist_options would give your users a set of options plus the ability to enter their own text. But if that's not going to do the job then you could customise the JavaScript by doing something like

$('input[type="text"]').attr('autocomplete', 'email');  // or whatever value you want (and is supported by your browsers)

Original comment by: campbell-m

jberanek commented 5 years ago

Hi Campbell, Thanks for helping, it's working.

Original comment by: *anonymous