- Posts: 89
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Restrict Search Place To Map Extent
- KhemrajC
- Topic Author
- Offline
- Premium Member
Less
More
4 years 1 week ago #197115
by KhemrajC
Restrict Search Place To Map Extent was created by KhemrajC
Hi,
In the map display window for openstreetmap, I intend to have the "Restrict Search Place To Map Extent", checked and locked by default.
When it is off, it searches for the whole world. Also, the native search textbox is very slow.
Anyway, I shall have another reactive autocomplete text input in a previous question to better guide the respondent by focusing the map onto his area where he may fine tuned his location. I think this is useful especially when my country is not adequately covered by openstreetmap.
I am trying to tick the checkbox with this function:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
function check() {
document.getElementById("restrictToExtent_932887X118X1047").checked = true;
}
});
check();
</script>
And nothing is happening.
What is wrong?
Thanks and regards
Khemraj
In the map display window for openstreetmap, I intend to have the "Restrict Search Place To Map Extent", checked and locked by default.
When it is off, it searches for the whole world. Also, the native search textbox is very slow.
Anyway, I shall have another reactive autocomplete text input in a previous question to better guide the respondent by focusing the map onto his area where he may fine tuned his location. I think this is useful especially when my country is not adequately covered by openstreetmap.
I am trying to tick the checkbox with this function:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
function check() {
document.getElementById("restrictToExtent_932887X118X1047").checked = true;
}
});
check();
</script>
And nothing is happening.
What is wrong?
Thanks and regards
Khemraj
Attachments:
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
4 years 1 week ago #197141
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Restrict Search Place To Map Extent
Try this:
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:complete',function() { $('#question{QID} input:checkbox[id^="restrictToExtent_"]').prop('checked', true).trigger('change'); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- KhemrajC
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 89
- Thank you received: 0
4 years 1 week ago #197151
by KhemrajC
Replied by KhemrajC on topic Restrict Search Place To Map Extent
Hi,
I just added that the specific project generated LS ID for the checkbox, 932887X118X1047 and its working!!!
I want to understand the logic behind.
So its using jquery to access DOM.
Any link to the manual to better learn these LS JQuery techniques?
Thanks and regards
I just added that the specific project generated LS ID for the checkbox, 932887X118X1047 and its working!!!
I want to understand the logic behind.
So its using jquery to access DOM.
Any link to the manual to better learn these LS JQuery techniques?
Thanks and regards
The topic has been locked.
- tpartner
- Away
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3593
4 years 1 week ago #197152
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Restrict Search Place To Map Extent
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.