Domain Search Function

Home Forums Porto – Responsive HTML5 Template Domain Search Function

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10024119
    brian7974
    Participant

    Hi there,
    Love you theme, very clean and functions great. One problem I could not see any write up on how to get the domain search function to work on the demo site (corporate hosting template)?

    I have not had any time to dig into all the code yet but really looking forward in it. But I just wanted to ask this question before I start redoing my website https://smithcd.com I am going to use your corporate hosting template for my site and having the clients be able to search a domain name would rock!!!

    Brian


    #10024121
    Support
    Keymaster

    Hello, thanks for your purchase.

    Here’s my suggestion to make it work:

    HTML (for that specific form area from Porto Hosting demo):

    <section class="parallax section section-text-light section-parallax section-center mt-none mb-none" data-stellar-background-ratio="0.5" style="background-image: url(img/parallax-hosting.jpg);" id="search-domain">
    	<div class="container">
    		<div class="row">
    			<div class="col-md-8 col-md-offset-2 center">
    				<h2 class="heading-light mb-none">Search <strong>Domain</strong></h2>
    				<p class="mb-xl">Enter the domain name to register or transfer</p>
    
    				<form class="form-horizontal" action="#" method="post" id="domainSearchForm">
    					<div class="form-group form-group-lg">
    						<div class="col-sm-12">
    							<div class="input-group">
    								<input type="text" name="sld" class="form-control" aria-label="..." placeholder="Enter your domain" required data-msg-required="Please enter your domain.">
    								<input type="hidden" name="tld" value=".com">
    								<div class="input-group-btn">
    									<button type="button" class="btn btn-default btn-lg dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" id="tldBtn">.com <span class="caret"></span></button>
    									<ul class="dropdown-menu dropdown-menu-right" id="tld">
    										<li><a href="#">.com</a></li>
    										<li><a href="#">.net</a></li>
    										<li><a href="#">.org</a></li>
    										<li><a href="#">.eu</a></li>
    										<li><a href="#">.us</a></li>
    									</ul>
    								</div>
    							</div>
    						</div>
    					</div>
    					
    					<button class="btn btn-lg btn-primary mt-md" href="#">Search Domain</button>
    				</form>
    
    			</div>
    		</div>
    	</div>
    </section>

    JS:
    (js/custom.js)

    (function($) {
    
    	'use strict';
    
    	// Domain Search Form
    	$('#domainSearchForm').validate({
    		submitHandler: function(form) {
    
    			var $form = $(form);
    
    			$.magnificPopup.open({
    				items: {
    					src: 'php/whois.php?domain=' + $form.find('[name=sld]').val() + $form.find('[name=tld]').val()
    				},
    				type: 'ajax',
    				tLoading: '<div class="bounce-loader"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div>',
    				mainClass: ''
    			});
    
    		},
    		errorPlacement: function(error, element) {
    			error.appendTo(element.parent().parent());
    		}		
    	});
    
    	// Domain Dropdown
    	$('#tldBtn').html($('input[name=tld]').val() + ' <span class="caret"></span>')
    
    	$('#tld a').on('click', function(e) {
    		e.preventDefault();
    		$('input[name=tld]').val($(this).text());
    		$('#tldBtn').html($(this).text() + ' <span class="caret"></span>')
    	});
    
    }).apply(this, [jQuery]);

    PHP:
    (php/whois.php)

    Code from: http://www.phpeasycode.com/whois/

    http://pastebin.com/Av61b3kN

    I hope it helps.

    Kind Regards,

    Jonas


    #10024602
    brian7974
    Participant
    #10024603
    brian7974
    Participant

    Ok I deleted some of my Vendor Necessities again, got it working!!!
    CASE CLOSED lol


    #10024613
    Support2
    Keymaster

    Hello,

    Great! 🙂

    Let me know if you need further assistance.

    Kind Regards,

    Rodrigo.


Viewing 5 posts - 1 through 5 (of 5 total)

This topic is marked as "RESOLVED" and can not rceive new replies.