Not Solved Registration stuck on Checking if username is available
#3
Not Solved
it's throwing a select2 is undefined in the following jsĀ 


{
MyBB.select2();
$("#referrer").select2({
placeholder: "Search for a user",
minimumInputLength: 2,
multiple: false,
ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
url: "xmlhttp.php?action=get_users",
dataType: 'json',
data: function (term, page) {
return {
query: term, // search term
};
},
results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};
}
},
initSelection: function(element, callback) {
var value = $(element).val();
if (value !== "") {
callback({
id: value,
text: value
});
}
},
});
}
// -->
</script>
<!-- end: member_register_referrer -->
<!-- start: member_register_regimage -->
<br />
<fieldset class="trow2">
<script type="text/javascript">

and if you look at the general.js there is Uncaught TypeError: Cannot read property 'select2' of undefined

In the "if" statement

/
/ Fixes https://github.com/mybb/mybb/issues/1232
 select2: function()
{
if(typeof $.fn.select2 !== "undefined")
{
$.extend($.fn.select2.defaults, {
Reply


Messages In This Thread
RE: Registration stuck on Checking if username is available - by saucerman - 2020-05-09, 07:53 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)