Hyperlink with textbox

Discussion in 'JavaScript' started by needhits.net, Jul 6, 2013.

  1. #1
    Hi

    I want to create a hyperlink on my site for client to find there login page(No search of database wanted).
    My accounts are uploaded to subdomians.
    I want a text box (subdomain) hyperlink:
    Example:
    (textbox).website.com (click Here)

    What I have so far:
    <input type="text" value="">.activehosted.com/admin/
    Code (markup):
    I am reseller for activecampaigns.com and need a page similar to there page http://www.activecampaign.com/login/ (but on my site - don't want iframes)
     
    needhits.net, Jul 6, 2013 IP
  2. shofstetter

    shofstetter Well-Known Member

    Messages:
    178
    Likes Received:
    7
    Best Answers:
    1
    Trophy Points:
    120
    #2
    The site you referenced is basically using a fancy select box generated with javascript. You can do the same thing with a plain old html select/option box and some simple javascript. Here you go as an example:


    
    <script type="text/javascript">
    function login_load() {
        var domain,subdomain;
        domain = document.getElementById('domain');
        sub_domain = document.getElementById('sub_domain');
        if(sub_domain.value !== "") {
              window.load("http://"+sub_domain.value+domain.options[domain.selectedIndex].value);
        }  else {
              alert("please enter your sub-domain");
        }
    }
    </script>
    <input type="text" value="" name="sub_domain" id="sub_domain">
    <select name="domain" id="sub_domain">
    <option value=".activehosted.com/admin" selected>.activehosted.com/admin</option>
    <option value=".someother.com/admin">.someother.com/admin</option>
    <option value=".yetanother.com/admin">.yetanother.com/admin</option>
    </select>
    <input type="button" value="login" onclick="login_load();">
    HTML:
     
    shofstetter, Jul 15, 2013 IP