You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 17, 2022. It is now read-only.
I've run into a problem with desktop v. mobile forms executing the way I've intended for them to be. Specifically, for the desktop version, everything functions properly; however, for the mobile version, results are displayed properly, but the onClick functionality doesn't work in that when a specific result is selected, nothing happens -- the result doesn't load in the text input box.
Specifically, I've got code something like this (at least while I'm troubleshooting):
...
<!-- Desktop -->
<div class="hidden-xs">
<input type="text" name="model_number" id="ls_query" class="form-control mySearch" placeholder="Desktop world ...">
</div>
<!-- Mobile -->
<div class="visible-xs">
<input type="text" name="model_number" id="ls_query_2" class="form-control mySearch" placeholder="Mobile world ...">
</div>
...
<script type="text/javascript" src="/AjaxLiveSearch/js/ajaxlivesearch.js"></script>
<script>
jQuery(document).ready(function(){
jQuery(".mySearch").ajaxlivesearch({
loaded_at: <?php echo time(); ?>,
token: <?php echo "'" . $handler->getToken() . "'"; ?>,
max_input: <?php echo Config::getConfig('maxInputLength'); ?>,
onResultClick: function(e, data) {
// get the index 0 (first column) value
var selectedOne = jQuery(data.selected).find('td').eq('0').text();
// set the input value
jQuery('#ls_query').val(selectedOne);
// hide the result
jQuery("#ls_query").trigger('ajaxlivesearch:hide_result');
},
onResultEnter: function(e, data) {
// do whatever you want
// jQuery("#ls_query").trigger('ajaxlivesearch:search', {query: 'test'});
},
onAjaxComplete: function(e, data) {
}
});
})
</script>
Aside: The responsive functionality doesn't work out of the box, so I've resorted to using two different forms which result in two separate queries being executed so that I can have more information being displayed in the desktop version than is displayed in the mobile version.
Note: I'm also concerned about what's going to happen when two separate forms will need to be loaded on the same page.
I look forward to hearing from you with anticipation,
M
The text was updated successfully, but these errors were encountered:
I don't think it's a good idea to have two forms, one for desktop and one for mobile. Which mobile device and OS you have got the 'onClick' issue? I'll try to reproduce it.
The phenomenon occurs independent of device, operating system and/or browser, so take your pick. My client is using a recent iPhone, so that might be useful most for testing with them.
I've run into a problem with desktop v. mobile forms executing the way I've intended for them to be. Specifically, for the desktop version, everything functions properly; however, for the mobile version, results are displayed properly, but the onClick functionality doesn't work in that when a specific result is selected, nothing happens -- the result doesn't load in the text input box.
Specifically, I've got code something like this (at least while I'm troubleshooting):
...
...
Aside: The responsive functionality doesn't work out of the box, so I've resorted to using two different forms which result in two separate queries being executed so that I can have more information being displayed in the desktop version than is displayed in the mobile version.
Note: I'm also concerned about what's going to happen when two separate forms will need to be loaded on the same page.
I look forward to hearing from you with anticipation,
M
The text was updated successfully, but these errors were encountered: