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

  • SEARCH
  • Home
  • 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 7938139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:43:17+00:00 2026-06-03T22:43:17+00:00

I have a a drop down filed like below. HTML and PHP <select id=selectform_0>

  • 0

I have a a drop down filed like below.

HTML and PHP

 <select id="selectform_0">
    <option value="0">1</option>
    <option value="1">2</option>
    <option value="2">3</option>
    <option value="3">4</option>
    <option value="4">5</option>
    </select>


<input type="button" onclick="selectValue(<?php echo $id; ?>)
">

And Javascript

<script>
function selectValue(id)
{
  //take select value
  alert(selectvalue);
}
</script>

is there anyway to take value from it by javascript strictly by not using <form>

  • 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-03T22:43:19+00:00Added an answer on June 3, 2026 at 10:43 pm

    Try this

    Javascript

    <script>
    function selectValue(id)
    { 
    var obj = document.getElementById("selectform_"+id).options[document.getElementById("selectform_"+id).selectedIndex].value;
    alert(obj);
    }
    </script>
    

    HTML

    <select id="selectform_0">     
    <option value="0">1</option>     
    <option value="1">2</option>     
    <option value="2">3</option>     
    <option value="3">4</option>     
    <option value="4">5</option>     
    </select> 
    
    <input type="button" onclick="selectValue(<?php echo $id; ?>) "> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I have drop down menu that looks like this: <select> <option>0</option> <option selected=selected>1</option>
I have a drop down in html. When I change the value of the
I have one drop-down list (<select> <option>) on page with id="coclevel1" . If current
I have capture change event on drop down select. This drop down field is
I have a drop down list where users can select a theme for the
I have a simple drop down box on a page with the below code:
I have a client who would like to have drop down list added to
i have an dropdown like this: <select id=cbvms name=cbvms class=SelectList> <?php foreach($vm_array as $key
I have a drop down list (select) populated from SQL. This is dynamic so
I have the following CSS/HTML setup http://jsfiddle.net/UDAUY/ How do I align the drop down

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.