Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Mar 2008
    Location
    Co.Tyrone, Ireland
    Posts
    80
    Thanks
    8
    Thanked 1 Time in 1 Post

    Joining Input Fields

    Hi Everyone,

    Im trying to add input fields within the URL.

    What im trying to do is get the user to enter information and then choose an extension from a list. When they submit the form, I want the Extension to be joined to the input field which the user has entered the information.

    Example:

    User Enters:
    Donno24
    Selects From Dropdown:
    .com

    When submit is entered I want the URL to be
    domain=Donno24.com
    Not
    domain=Donno24&extension=.com

    Hope you can help,
    Donno24

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    You'd need to depend on some javascript for this. Say, in the onsubmit event of form, execute a javascript code like
    Code:
    window.location="http://yourdomain.com?domain="+yourform.element1.value+yourform.element2.value;
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Mar 2008
    Location
    Co.Tyrone, Ireland
    Posts
    80
    Thanks
    8
    Thanked 1 Time in 1 Post
    Sorry im no good at javascript, here is my form code, can you explain a bit more..

    Code:
    <form action="mod.php" method="get" onsubmit="return formCheck(this);" name="whois">
    <input name="mod" type="hidden" size="20" maxlength="150" value="orders" />
    
    <input name="ord_domain" type="text" size="20" maxlength="150" />
    <select name="extension">
    <option>.ie</option>
    <option>.com</option>
    <option>.eu</option>
    <option>.net</option>
    <option>.info</option>
    <option>all</option>
    </select>
    
    
    <input name="Submit" type="submit" value="Proceed" />
    <br />(<span class="style1">YourDomain.ie / com / co.uk</span>)
    </form>
    This is the javascipt:
    Code:
    window.location="http://MYWEBSITE.com/bills/mod.php?mod=orders&ord_domain="+whois.ord_domain.value+whois.extension.value;
    Last edited by Donno24; 07-16-2008 at 11:19 AM.

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,862
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    At the end of your formCheck() function, after all validations, have a try by adding
    Code:
    var domain=document.whois.ord_domain.value;
    var tld=document.whois.extension.value;
    
    window.location=http://MYWEBSITE.com/bills/module.php?mod=orders&domain=domain+tld
    But this won't work if javascript is disabled, so you need to have two set of codes to receive the values in the next page.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New Coder
    Join Date
    Mar 2008
    Location
    Co.Tyrone, Ireland
    Posts
    80
    Thanks
    8
    Thanked 1 Time in 1 Post
    Thank You, I got it working okay!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •