- Posts: 168
- Thank you received: 2
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // AJAX call to the PHP file $.get('https://pathTo/returnIP.php', function(data) { // Create an array of the IP address character sets var ipArray = data.split('.'); // Load the text element with the first character set in the array $('input:text', thisQuestion).val(ipArray[0]); }); }); </script>
<?php $ip = $_SERVER['REMOTE_ADDR']?:($_SERVER['HTTP_X_FORWARDED_FOR']?:$_SERVER['HTTP_CLIENT_IP']); echo $ip; ?>
Of course you can, but there are other feature requests that I would consider far more important waiting for years now, so I think chances are low that this will be implemented as a feature. Maybe someone creates a Plugin for it.Is it a "feature request-able" thing that I can post (an option that lets the survey creator choose if to collect full IP or part of it to the survey)?