Hi,
I did many test. On PART 2 you have the answer to your last answer and on PART 1 you have the result of a test I did
>>>> PART 1 <<<<
I did a test page that call your service and normally I have the correct rest answer but, sometime, I have the first page of my site as rest answer. Could be this the problem? the address of my test page is on fields and you can look at the simple source simply looking at HTML Source with the browser
ON ERROR ( I'VE USED INCOGNITO/PRIVATE BROWSING TO HAVE THIS ERROR AND CLICKED "TEST REGISTER" BUTTON MANY TIMES):
Considering this situation/test is possible that this ticket it's the same problem of my other ticket:
https://www.joomlart.com/forums/d/29006-problems-on-login
>>>PART 2<<<<
On ftp info field I've added a video for you to see the problem. We tryed with 4G and 2G network
On registration you write your username. After you pass to the next field and you see this red "Undefined error" that you see in previous pictures
I need the Javascript code that check the username (and other fields) and show this error when you pass from a field to another
Some clues to understand my bad English:
<div class="joms-form__group">
<span><?php echo JText::_('COM_COMMUNITY_USERNAME'); ?> <span class="joms-required">*</span></span>
<input type="text" name="jsusername" value="<?php echo $data['html_field']['jsusername']; ?>" class="joms-input"
data-required="true" data-validation="username">
</div>
Where is the function called because data-validation="username" ?
I see there is a network call:
azrul_ajax
option: community
func: register,ajaxCheckUserName
no_html: 1
arg2: ["_d_","panka7"]
arg3: ["_d_",""]
with an answer:
{"success":true}
The status code of the answer is 200. Probably when there are network problems, the status is not 200 so I wish a message "Network error (HTTP_STATUS_CODE)" instead of "undefined error" and I wish that this call is retryed few times before giving the error (this could be useful in unreliable mobile networks).
In this way the user will receive a correct error to know that has problems in his mobile network and also with some retries is possible the show of error will not be needed when the network is not so reliable.
With status code I mean: https://www.restapitutorial.com/httpstatuscodes.html
As example you could write (instead of undefined error) "Network error (400)" where 400 is the http status code received on the rest call
Sorry for my english, I hope that with those source code/debugger clues now is clear
Thanks!