Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6358169
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:18:59+00:00 2026-05-24T23:18:59+00:00

I’m making a web page using CGI scripting which has a form users need

  • 0

I’m making a web page using CGI scripting which has a form users need to fill out. The general layout is:

<form>
textfield (username)
textfield (password)
textfield (email)
submit button
</form>

What I would like to do is add a button that checks to see if the username they’ve entered is available. My problem is the way I’m trying to go about doing this is by writing:

<form>
<form>
textfield (username)
submit button
</form>
textfield (password)
textfield (email)
submit button
</form>

This doesn’t work, the submit button instead submits the outer form. Here are the things I’ve considered trying but have not worked:

  1. Put a form at the end of the first form. Problem: I have no idea how to align the “validate” button next to the username text field button without making it float which causes a bunch of other issues with the page.

  2. Put values on the submit buttons and make the submit do different things based on which button was clicked. Problem: the web page that I want to make a “POST” request to is different based off which button is pressed. Seeing as I put the action=”mypage.cgi” in the portion of the code, and not the button portion, I don’t know how to make it go to different sites based on which button I press.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:19:00+00:00Added an answer on May 24, 2026 at 11:19 pm

    First of all it is a good idea to give all forms names.
    So you can easily distinguish between forms.

    Next, attach onClick even to each button that would call a function with a different paramenter: 1,2,3. Each button would send its own parameter. In the function you just look at the paramenter and submit appropraite form.

    <form name='form1'>
    ....
    <button type="button" onClick=doIt(1);>Submit</button>
    </form>
    
    <form name='form2'>
    ....
    <button type="button" onClick=doIt(2);>Submit</button>
    </form>
    
    <form name='form3'>
    ....
    <button type="button" onClick=doIt(3);>Submit</button>
    </form>
    
    <script>
    function doIt(formid)
    {
       if(formid==1)
       {
          document.form1.submit();
       }
       if(formid==2)
       {
          document.form2.submit();
       }
    
    ...
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to count how many characters a certain string has in PHP, but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am using Paperclip to handle profile photo uploads in my app. They upload
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.