+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Error when adding website URL during listing submission.

  1. #1
    Senior Member
    Join Date
    Aug 2010
    Posts
    174

    Error when adding website URL during listing submission.

    When I’m trying to add a website URL without "http://", the system gives me an error.
    It takes time for users to find out what was the problem.
    So, I’m considering this as a Bad User experience.

    Please refer to the snapshot in attachment.
    Attached Images Attached Images
    Last edited by PGGO; May 8, 2012 at 02:00 AM.

  2. #2
    Master
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    421
    Hi Petnax,

    check this ->
    open the File includes/classes/rlValid.class.php

    In Line 266 there is the function getDomain

    Code:
    Only registered members can view the code.
    The following code checked the url for http, https and also ftp. But u need only the check for http.

    Code:
    Only registered members can view the code.
    Change function getDomain with following code and test it

    Code:
    Only registered members can view the code.
    Now the website Field will check for http://

    The only Problem is the message. I found no solution for this. But i think the Flynax Team can help you for this.
    The regular message is:
    The data you have entered in the "Website" field are incorrect.
    It would be better Message:
    The data you have entered in the "Website" field are incorrect. Correct input for example http:// www. your-domain. com
    This Message is in the phrase key: notice_field_incorrect
    But this message is not only for the Website Field. It is better to use a separate phrase for the Website field error. this is a Job for Flynax team...

    Best regards
    Steffen
    Last edited by Steffen Buschkemper; May 8, 2012 at 06:08 AM.

  3. #3
    Senior Member
    Join Date
    Aug 2010
    Posts
    174
    Hi Steffen,

    Thank you for your suggestion; however, after I added this code, nothing happened.

    I hope Flynax will take some action in order to fix this error.

  4. #4
    Master
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    421
    Hi Petnax,

    It works for me. There are no problems.

    Best regards
    Steffen

  5. #5
    Hi all,

    If you want to remove url checking you can just edit the field, open edit field page in AP and you'll see that the field has URL as checking condition.

    You can just remove it for the field and it will allow any text.

    If it's not what you want and you want script to validate urls with or without www solution in code is below.

    <b>For those who want to allow links without leading http:// try changes below.</b>

    includes/classes/rlValid.class.php

    Code:
    Only registered members can view the code.


    <b>To make different error message for the URL fields make following changes.</b>


    open includes/classes/rlCommon.class.php and find function checkDynamicForm

    find code in the function which handles text fields with condition:

    ~340 line
    Code:
    Only registered members can view the code.
    and change to

    Code:
    Only registered members can view the code.

    And through Languages manager add new phrase with key notice_url_field_incorrect with your new error message
    Phrase text should be like this

    "The data you have entered in the {field} field are incorrect. Correct input for example http://www.your-domain.com/"
    Last edited by Mike; May 9, 2012 at 04:26 AM.

  6. #6
    Senior Member
    Join Date
    Aug 2010
    Posts
    174
    Mike:

    I added the code (first code) you suggest; however, it does not work.
    Getting the same issue, the system does not allow me to add a website URL without “http://”

    I want to add "www.mysite.com", but system accept it only as "http://www.mysite.com"

  7. #7
    Master
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    421
    Hi Pentax,

    there is an mistake. LoL
    But i think the url with http:// is a better solution.
    Not all urls must have a www. syntax!
    Flynax has a problem without www!
    But not if you type http://your-domain.de


    Best regards
    Steffen

  8. #8
    Senior Member
    Join Date
    Aug 2010
    Posts
    174
    The reason why I’m considering this as a bad user experience, because most people prefer to type their own domain name starting with www.mysite.com rather than with http://www.mysite.com

    It's not a good idea to serve an error every time someone is trying to add a new listing.

    The best solution is to accept both version, with http:// and without.

  9. #9
    There is mistake! Sorry for that.

    getDomain is wrong function for those changes

    please roll back changes made to getDomain function and apply them to isUrl function (rlValid class)

    Code:
    Only registered members can view the code.

  10. #10
    Master
    Join Date
    Apr 2012
    Location
    Germany
    Posts
    421

    Cool Solution for -> Error when adding website URL during listing submission.

    Hi Petnax,

    Forget everything that was written before!
    I have a good solution for you.
    This solution is at first only for Account details.
    There is also the same problem!

    But the same solution you can us in add listings, but the input field name is other and must be changed in my script!
    Its this part-> $('input[name="-Here you must put in the input fieldname-"]').blur(function()
    The easy way to find out the field name is firebug (Firefox). I think the fieldname is -> f[website]. But i am not sure.
    Then you can put in the script in templates/*your-template*/tpl/add_listing.tpl after <script type="text/javascript" src="{$smarty.const.RL_LIBS_URL}ckeditor/ckeditor.js"></script>
    Open the file in templates/*your-template*/tpl/controllers/profile.tpl
    After the follow part ->
    Code:
    Only registered members can view the code.
    Paste the following code below

    Code:
    Only registered members can view the code.
    And now there are no problems!
    You can write without http:// -> "your-domain.de" or www. your-domain.de
    The script add automatically the "http://" and there are no Error 404
    I think that is what you want.

    jQuery Rocks! :cool:

    Sorry for my bad english!

    Best regards
    Steffen
    Last edited by Steffen Buschkemper; May 16, 2012 at 06:58 PM.

+ Reply to Thread