#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    48
    Rep Power
    11

    Overlapping forms


    I have a page I'm working on that has two forms on it. The purpose of this page is to ask wether the user wants a domain name or subdomain name and, if he wants a domain name, give him the option to check it. The problem is that the domain name checker form ends up in the middle of the main form and I can't get the submit button to work on the main form. I'll try to explain it below:

    Code:
    <form name="main_form" action="next_step.php">
    <input ...>  -- what type of site access he wants (domain or sub)
    
    <form name="check_url" action="check_url.php">
    <input ...> what the domain name is
    <input type="submit">
    </form> 
    
    <!--continue main form-->
    <input...> -- if he wants a transfer.  He types it here.
    <input type="submit">
    </form>
    How can I make both forms work. I don't need any values from the "check_url" form because I'm saving those as php variables. I just need the variables above the "check_url" form and the variables below the form to get submitted with the submit botton at the bottom.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2004
    Posts
    185
    Rep Power
    12
    I don't think you're allowed nested forms, have a look at this thread
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2004
    Posts
    48
    Rep Power
    11
    I ended up writing a simple javascript function to handle the middle ("domain") form. For future reference, here's the code:

    This is the function call:
    Code:
    <input type="button" value="Check Availability" onClick="javascript:checkDomain(document.myForm.domain.value , document.myForm.extention.value)">
    And this is the function definition:
    Code:
    <script language="JavaScript" type="TEXT/JAVASCRIPT">
    		
    function checkDomain(domain , type)
    {
      document.location='domain_tester.php?domain=' + domain + '&type=' + type
    }
    	
    </script>

IMN logo majestic logo threadwatch logo seochat tools logo