How to get the code of domain name search and other forms?

Discussion in 'Styling and Customization Questions' started by Juanito, Jan 23, 2016.

  1. Juanito

    Juanito New Member

    Joined:
    Jan 23, 2016
    Messages:
    2
    Likes Received:
    1
    Hi,
    I would like to know where to go to copy the code and add it to a website? Should be just inpect element and copy that code? Or is there a script to do this?

    Cheers
     
    #1
    shahidi likes this.
  2. Juanito

    Juanito New Member

    Joined:
    Jan 23, 2016
    Messages:
    2
    Likes Received:
    1
    Hello? Bump??
     
    #2
  3. CE-Matt

    CE-Matt Administrator Staff Member

    Joined:
    Aug 27, 2011
    Messages:
    1,571
    Likes Received:
    274
    Code:
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <input id="domainname" type="text" name="domainname" value='yournewsite.com' />
    <input id="submit-button" type="submit" value="Search Domain">
    <script type="text/javascript">
    var ceURL = 'http://www.changeme.com/clientexec/';
    var groupId = 2;
    $('#submit-button').click(function(e) {
    e.preventDefault();
    var fullname = $('#domainname').val();
    if ( fullname.indexOf(".") == -1 ) {
    $('#domainname').addClass('domain_fail');
    $('#domainname').val(fullname+' - not a valid domain name');
    } else {
    var name_array = fullname.split('.');
    $.post(ceURL + 'index.php?fuse=clients&action=checkdomain',
    {
    name: name_array[0],
    tld: name_array[1],
    group: groupId
    }, function(response) {
    console.log(response);
    if ( response.error ) {
    alert(response.message);
    } else {
    var domainStatus = response.search_results.status;
    if ( domainStatus == '0' ) {
    window.location = ceURL + 'order.php?step=0&productGroup=' + groupId + '&domainName=' + name_array[0] + '&tld=' + name_array[1];
    } else if ( domainStatus == '1' ) {
    window.location = ceURL + 'order.php?step=0&productGroup=' + groupId + '&domainName=' + name_array[0] + '&tld=' + name_array[1];
    } else {
    alert('there was an error, please try again later');
    }
    }
    }, 'json');
    }
    return false;
    });
    </script></pre>
    
    You will need to input your domain and path to CE install on line 5.
    Lastly, you will need to enter the domain product group in line 6.
     
    #3

Share This Page