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 8226467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:46:55+00:00 2026-06-07T15:46:55+00:00

I have a scenario where a visitor can select a value from a drop-down

  • 0

I have a scenario where a visitor can select a value from a drop-down box, and then choose select one of two submit buttons [that trigger two different form actions and are both in separate elements].

The drop-down box is relevant for both submit buttons, however, is only under one of the element.

I’ve tried a write a javascript function that pulls the drop-down value from one form element to the other, but it doesn’t seem to work. PLease see my code below, any ideas?

<script type="text/javascript">
function grabselection(){
var select_genre = document.getElementById("genre");
var genre = select_genre.value;
var genre_cloaked = document.getElementById("genre2");
genre_cloaked.value = genre;
}
</script>


<form class="youtubeupload" action="uploadfinalised.php" method="post"      enctype="multipart/form-data">
<input name="token" type="hidden" value="Alhl"/>
<select  id="genre2" class="genre" name="genre"><option value="">What style is your video?</option></select>
<input value="" onclick="grabselection();" type="submit" id="uploadbutton" /></div>
    </form>     

<form id="provideurl" class="provideurl" method="post" action="provideurl.php">
<select id="genre" class="genre" name="genre">
    <option value="">What style is your video?</option>             
    <option id="genreid_1" value="1">first genre</option>
    <option id="genreid_2" value="2">second genre</option>
    <option id="genreid_3" value="3">third genre</option>
    <option id="genreid_4" value="4">fourth genre</option>  
</select>

I am sure there is a simpler solution to this – linking one form element to two different forms, but I’m not sure how to do it – any help greatly appreciated

  • 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-06-07T15:46:57+00:00Added an answer on June 7, 2026 at 3:46 pm

    You’re setting the value on the genre2 select box but it doesn’t contain any options with that value. To accomplish what you’re trying to achieve, the options would have to be defined in both select fields.

    Why don’t you just use a hidden input and update the value on that?

    <input type="hidden" name="genre2" />
    

    Arguably the best thing to do would be to determine the form action based on user input so that you only have 1 form… there’s a brief discussion here: http://www.javascript-coder.com/html-form/html-form-action.phtml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a scenario where I need to bind two properties from one class
I have a scenario where I need to upload a file from one web
I have scenario where i want the invoice numbers from two tables in csv
I have scenario, I have two update panels on the page (both have update
I have a scenario in which I have to run multiple commands one after
I have a scenario where combobox can have same string values. for exa combo
I have the scenario where the data from a single table must be in
I have a scenario where I have one thread that loops between waiting and
I have a scenario where users of my ASP.NET web application submit testimonials consisting
I have scenario where I have to poll documents from sharepoint library based on

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.