0

Hello,

I have a question, cek this code. It suppose to work like: http://www.soulfy.com/?a=add&pid=5

I move it to : http://www.soulfy.com/index.php

It doesn't work just like the top link if you check the domain name.

I have to add the following to code to the buttom codes to complete the code yet it turns out disappears the whole domain availability check instead of make it works.

I suppose to add this code:

function checkdomain() {
                var domainoption = jQuery(".domainoptions input:checked").val();
                var sld = jQuery("#" + domainoption + "sld").val();
                var tld = '';
                if (domainoption == 'incart') var sld = jQuery("#" + domainoption + "sld option:selected").text();
                if (domainoption == 'subdomain') var tld = jQuery("#" + domainoption + "tld option:selected").text();
                else var tld = jQuery("#" + domainoption + "tld").val();
                jQuery("#loading3").slideDown();
                jQuery.post("cart.php", {a: "domainoptions", sld: sld, tld: tld, checktype: domainoption, ajax: 1},
                        function (data) {
                            jQuery("#domainresults").html(data);
                            jQuery("#domainresults").slideDown();
                            jQuery("#loading3").slideUp();
                            $( ".domainregperiod" ).next( "div" ).hide();
                        });
            }

homepage.tpl

 <!-- Domain Registration -->

    <div class="row">
        <div class="col-md-12">
            <img src="img/SoulfyPagewPayLogos.png" height="100px" alt="" class="img-responsive center-block"/>
        </div>
    </div>

    <script type="text/javascript" src="includes/jscript/jqueryui.js"></script>
    <script type="text/javascript" src="templates/orderforms/comparison/js/main.js"></script>
    <link rel="stylesheet" type="text/css" href="templates/orderforms/comparison/style.css"/>
    <link rel="stylesheet" type="text/css" href="templates/orderforms/comparison/uistyle.css"/>

    <center>

        <div class="domainoptions">
            <div><label><input type="radio" name="domainoption" value="register"/> New Soulfy Registration</label>
            </div>
            <!--  <div><label><input type="radio" name="domainoption" value="transfer"/> Transfer domain anda dari
                      registrar lain</label></div> -->
        </div>

        <form class="col-md-4 col-md-offset-4" onsubmit="checkdomain();return false">

            <div class="domainreginput" id="domainregister">
                www. <input type="text" class="" id="registersld" size="30" value=""/>
                <select id="registertld" class="">
                    <option value=".com">.com</option>
                    <option value=".net">.net</option>
                    <option value=".org">.org</option>
                </select>
            </div>
            <br>

            <p align="center"><input type="submit" value="Check Availability" class="cartbutton btn btn-default"/>
            </p>

            <p><em>support@soulfy.com | +62-21-420-4132</em></p>
        </form>

        <br><br><br><br><br><br>

        <div class="row">
            <div class="col-md-12">
                <div id="loading3" class="loading"><img src="images/loading.gif" border="0" alt="Loading..."/></div>

                <form method="post" action="cart.php?a=add&pid=5" id="domainfrm">
                    <input type="hidden" name="token" value="fcf5845f9cba8deea2d48cb8133176743eb9b8b7"/>
                    <div class="col-md-4 col-md-offset-4" id="domainresults"></div>
                </form>
            </div>

            <div class="col-md-12">
                <a href="http://soulfy.com/index.php"> <img src="img/soulfy.jpg" width="450px" alt=""
                                                            class="img-responsive center-block"/></a>
            </div>
    <div class="col-md-12">
                <a href="http://soulfy.com/index.php"> <img src="img/reseller.jpg" width="400px" alt="Ayo Bergabung Jadi Reseller"
                                                            class="img-responsive center-block"/></a>
            </div>
        </div>

<script>
jQuery(".domainreginput").hide();
            jQuery(".domainoptions input:first").attr('checked', 'checked');
            jQuery("#domain" + jQuery(".domainoptions input:first").val()).show();
            jQuery(document).ready(function () {
                jQuery(".domainoptions input").click(function () {
                    jQuery("#domainresults").slideUp();
                    jQuery(".domainreginput").hide();
                    jQuery("#domain" + jQuery(this).val()).show();
                });
            });        
</script>            

<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function () {
    $("#btn_search").on("click", function () {
        var prev = $(this).html();
        var btn = this;
        $(this).html('<i class="fa fa-spinner fa-spin"></i> Loading');

        $.ajax({
            type: "POST",
            url: 'domain_check.php',
            crossDomain: true,

            data: {
                domain: $("#txt_domain").val()
            },
            success: function (data) {
                $("#result").html(data);
            },
            error: function () {

            },
            complete: function () {
                $(btn).html(prev);
            }
        });
    });
});

</script>

<!-- Domain Registration End -->
2
Contributors
1
Reply
22
Views
4 Months
Discussion Span
Last Post by pty
1

So what's the question?

Have you ever thought about learning web development rather than just copy/pasting random stuff you find on the internet until it looks like it's working?

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.