Home › Forums › Porto – Responsive HTML5 Template › Domain Search Function
- This topic has 4 replies, 3 voices, and was last updated 6 years, 3 months ago by Support2. This post has been viewed 1296 times
-
AuthorPosts
-
December 28, 2017 at 9:14 am #10024119brian7974Participant
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
December 28, 2017 at 9:56 pm #10024121SupportKeymasterHello, 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/
I hope it helps.
Kind Regards,
Jonas
January 31, 2018 at 5:18 pm #10024602brian7974ParticipantJanuary 31, 2018 at 5:42 pm #10024603brian7974ParticipantOk I deleted some of my Vendor Necessities again, got it working!!!
CASE CLOSED lol
January 31, 2018 at 10:59 pm #10024613Support2KeymasterHello,
Great! 🙂
Let me know if you need further assistance.
Kind Regards,
Rodrigo.
-
AuthorPosts
This topic is marked as "RESOLVED" and can not rceive new replies.