List/menu options from database

Hello
I need help trying to populate 2 list/menu with some database information.
Let's suppose that this is my table:
Id
Brand
Model
1
ford
f1
2
citroen
c1
3
citroen
c2
4
citroen
c3
5
toyota
t1
6
toyota
t2
7
volvo
v1
I have 2 list/menu. One is  the brand menu, which extracts the values  in the brand column of the database (using the DISTINCT statement in MySql). So when you click the menu, these options appear:
ford
citroen
toyota
volvo
The  code for that menu is something like  this:
<select name="menu_marque" id="menu_marque">
<option value="null">select</option>
<?php do {  ?>
<?php
print '<option  value="'.$row_marque_recordset['marque'].'">'.$row_marque_recordset['marque'].'</option>' ;
?>
<?php } while ($row_marque_recordset =  mysql_fetch_assoc($marque_recordset)); ?>
</select>
Now,  I want to do the same for the model menu.  The problem is that I don't know how to write in the Sql, that it  should take the selected value of the brand menu.  I have something like this:
SELECT modele FROM test WHERE marque  = 'colname' ORDER BY modele ASC
(where colname is:  $_POST['menu_marque']..... Obviously I am not getting the value by a  POST method, but I tried changing it to something like:
menu_marque.selectedIndex
but  it doesn't work...... Any tips on how can I solve this

Hi DanielAtwood,
Thanks for your reply...
Actually when i send the variable in 'WHERE Clause' in Db Adapter query it will retrieve more than one record as the output.
I want to put that values to a 'SelectOneChoice' component and list down all the values..
First I tried with data control. But i couldn't find the way to pass the value to the variable(in WHERE clause) to the query in data control view.
Thanks,
Nir

Similar Messages

  • List of values from Database Adapter - BPM Forms

    Hi all,
    Can anyone tell me how to get list of values from Database adapter and a ServiceTask.
    As example lets say a table has Employee and Department columns.
    I want to list down all the Employees in BPM form (Select One List Box) once i provide the department to the Database Adapter.
    Is it possible from the DB Adapter?? What will be the variable type?
    Thanks,
    Nir

    Hi DanielAtwood,
    Thanks for your reply...
    Actually when i send the variable in 'WHERE Clause' in Db Adapter query it will retrieve more than one record as the output.
    I want to put that values to a 'SelectOneChoice' component and list down all the values..
    First I tried with data control. But i couldn't find the way to pass the value to the variable(in WHERE clause) to the query in data control view.
    Thanks,
    Nir

  • Select list in JSP (Options from database)

    I am developing a web application on struts.
    I am having problem with my JSP.
    I have a form from where users input the keywords for search
    and when they click on a database query is performed and
    result is shown on the screen.
    Where i am stuck is that in the display screen, i wanna have one
    set of result in the drop down list (same as select in html).
    If the result from the database search is 1 i want the first option of
    select to be Yes and if its 0 then i want the first option of select to be
    No.
    what i have in JSP is following
    <select name="attt" size="2"><option value="<bean:write name="sList" property="att"/>">Yes
    <option value="<bean:write name="sList" property="att"/>">No
    Where I am stuck is that I dont know where to perform whether the
    result from database is 1 or not. Can someboday help me on how
    to solve this or get this done? Am i right so far?
    thanx in advance

    The best I could come up with was to use the second layout I mention and then add some Javascript on the page to do something like
    <style type="text/css">
    label.l {position:absolute;top:100px;left:210px;}
    input.i {position:absolute;top:100px;left:200px;}
    </style>
    <script type="text/javascript">
    var f=$x('P1_RADIO');
    var l=f.getElementsByTagName('label')[1];
    var i=f.getElementsByTagName('input')[1];
    l.className += "l";
    i.className += "i";
    </script>Basically, it takes that "Radiogroup Option 2" and the form input field and uses absolute CSS positioning to place it to the right of the Select list.
    Works great in FF (as usual), but the usual IE inconsistencies with CSS box model rear their ugly head. Looks terrible in IE, totally mis-aligned.
    Any other ideas?
    Thanks

  • Stoping "Plesae Select" List/Menu Results from coming through

    Hi there, we have several list/menu's on our website form and
    want to know if theres a way of stopping all the "please select"
    results from coming through?
    "please select" comes through because the user hasent
    selected a result in the list menu.
    Cheers
    Malhyp

    MalRom wrote:
    > Hi there, we have several list/menu's on our website
    form and want to know if
    > theres a way of stopping all the "please select" results
    from coming through?
    >
    > "please select" comes through because the user hasent
    selected a result in the
    > list menu.
    As well as what Gary has suggested, you should always
    validate the input
    being submitted via a form. This can be done client-side with
    Javascript, or server-side with whatever language is
    available. It
    sounds like you can't edit the CGI which processes the form
    data and
    sends it, so do as Gary suggested, or use some client-side
    form
    validation. There are loads of examples online if you google
    for
    "javascript form validation"
    Dooza
    Posting Guidelines
    http://www.adobe.com/support/forums/guidelines.html
    How To Ask Smart Questions
    http://www.catb.org/esr/faqs/smart-questions.html

  • Populating drop down menu's from database dynamically

    Hi
    I m facing a problem of populating the drop down menu from a MS Access database using JSP. But i m not able to do it. Can you please help me out?
    this works perfectly for textarea
    <textarea cols="20" rows="20">
    <% for(int i =1; i <=rsmd.getColumnCount();++i)
    out.println(rsmd.getColumnName(i)); %>
    </textarea>
    but for drop down box it gives problems
    Heres the code!
    <select name="aa" ID = "aa">
    <option value="<% for(int i =1; i <= rsmd.getColumnCount();++i)
    out.println(rsmd.getColumnName(i)); %>" > </option>
    </select>
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 61 in the jsp file: /gv/event.jsp
    Generated servlet error:
    i cannot be resolved
    wat can be the alternative? Please hlp
    Regards
    Sami

    Hi i m facing a problem in jsp while filling the dropdown box<select name="combosubject"  width="10%" maxlength="20"/>
                                  <option ></option>
                                  <%
                                                System.out.println("1st time");
                                                rs=stmt.executeQuery("select subject.name from subject order by name");
                                                while(rs.next())
                                                  subject = rs.getString(1);
                                             %>     
                                             <option ><%=subject%></option>
                                             <%
                             rs.close();
                             stmt.close();
                       %>the problem is that when i execute this code for the first time it works fine and after that it keeps on throwing exception like "No data found", "Column not found"
    on <form> action i have recalled this function that is when i click the search button this page is executed again and at this moment i got the exception

  • Disable or Hide Online Support menu option from: Reader, Acrobat Standard and Pro XI 11.0.2

    Hi,
    I'm trying to make a custom installation for 3 applications: Adobe Reader XI 11.0.2, Acrobat Std. and Pro XI 11.0.2  and most of the options that I wanted to hide are done with the Customization Wizard but I can't hide Online Support. I didn't found yet any FeatureLockDown for this option so far. So our users can still use the Online Support options.
    Notice that I tried to drop a script into: C:\Program Files (x86)\Adobe\Reader 11.0\Reader\Javascripts   but when you 1st open the application it has a delay and somehow you still can access it. But if you try to open it again the menu is hidden.
    //HideMenu.js
    //Help - Online Support
    app.hideMenuItem("OnlineSupport");
    But a FeatureLockDown on HKLM hive will be the best way to disable this option as users don't have access to this registry hive and some advanced users with more rights could be able to delete the .js file if they know where it is saved.
    I will appreaciate your help to get this FeatureLockDown option if it exists or an alternative way.
    Thanks as usual and Kind regards everyone.
    Derspinne.

    Moved to Enterprise Deployment (Acrobat and Reader)

  • Has Mavericks removed the Reminder List sidebar option from Calendar?

    Before I upgraded to Mavericks, I found this feature very helpful - I had my general reminders (essentially a to-do list of items not yet tied to a specific date) sitting in the sidebar of Calendar - so that I could drag and drop them into a specific day once a gap opened in my schedule. This option does not seem to exist in Mavericks calendar. The reminders app is stand-alone, as far as I can tell - and, in addition, the app itself kind of *****. It's more clumsy to use/edit items than previously. Am I missing something? Is there a way to revert to my previous set up with the side-bar of reminders integrated into Calendar?

    Thanks, I think I understand now. I bought my Macbook in 2011 and it came with Lion OS - I had never upgraded to Mountain Lion, hence it's only now that I have upgraded to Mavericks that this issue has come up for me. I would prefer to avoid third-party apps, so I will just have to accept that the Calendar and Reminders are separate. Pity.

  • To Get List of Tables from Database which has the data 'AAAA' - T-SQL Query

    Hi,
    I have a database "Adventureworks", I need to get list of tables, which has the data 'AAAA' in their rows.
    Is there any optimised or simple way to do this task?
    Any T-SQL Query Available
    --- Thanks in advance..

    You can refer the same below URL provided by Praveen:
    https://gallery.technet.microsoft.com/scriptcenter/c0c57332-8624-48c0-b4c3-5b31fe641c58
    It has the SQL SP - "SP_SearchTables". You can pass parameters the way you want and get the expected output.
    -- Search for 'bike' instead of 'AAAA'
    Use AdventureWorks2012
    EXEC SP_SearchTables @Tablenames = '%', @SearchStr = '%bike%'
    -Vaibhav Chaudhari

  • Populate List from Database (Very Strange Behaviour)

    Dear Fellows,
    I have developed a from which has two lists One for Major (say) and Other for Minor (say), thesr minors are based on the value of Major.
    Now I have developed this system on Windows XP Professional, Developer/2000 6i and Oracle 8i (release 8.1.7).
    Major list is populated from database and it shows all major values now using 'when_list_change' trigger the minor list is populated from the database based on the value of major list. Interestingly enough it is working fine without any problem.
    Now I have deployed the software to Windows 2000 Professional/Server (tried on both), Developer/2000 6i and Oracle 8.0.5, but strangly the lists are not working now. First list (major) is still working but the other dependent lists are not working.
    Another strange thing is that it populate the second list for one particular value (only at times).
    The logic is that I have used a program unit to which i am passing 'list element' and 'query' and call it for each list in the when-list-change trigge.
    Now its a very strange behaviour, I don't know what to do?
    Your cooperation will be highly appreciated.
    regards.

    rolrollerx wrote:
    Hi,
    I have Nokia N8 (a great phone, btw) with Symbian Anna. I wanted to download the maps. But the PC Ovi Suite is just busy forever, without downloading anything (I used Performance Monitor to find out it was doing nothing for hours).
    As I have unlimited data plan from my phone, I decided to try updating directly from the phone instead. It successfully downloaded the list of maps, but when I selected one of them
    "No Wi-Fi network available. Please configure a WiFi access point in the phone Internet destination settings."
    Why should I do that? I have a working connection on that phone (as evidenced by the successful download of the list of maps). So now, I am stuck. How can I download the maps?
    Well, the suggestion is there. Use a router.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • List menu in oracle forms

    hi every body,,
    i face problem in dropdown list, i want to create employee list take date from database(daynamic) and another list it inclouded department number, when i change any list it will effct to seconde list.
    plz, help me if also you can provide me with any web or book or examples it cove my request.
    thanks lot..............

    modi wrote:
    thanks for your response,
    i read this example but i have some question for this :
    1- i create this trigger on display item or list item ?List item
    2-when i write rg_name VARCHAR2(40) := 'country'; this meaning my list or display item 'COUNTRY' name?yes it's country name...
    3-when i write 'SELECT country_name NAME, COUNTRY_ID VALUE FROM COUNTRY ORDER BY 2');
    this meaning i will display two column in list country_name NAME and COUNTRY_ID VALUE ?yesss
    4-when i write POPULATE_LIST('BLOCK3.COUNTRIES', rg_name); this datablock name and item name?yes list item name will be populated from the dynamic record group created from the query
    Sorrrrrrrrrrrrrrrrrrrrrry for this questionNever mind am willing for more... :)
    u Most Welcome :)
    Regards,
    Amatu Allah

  • Deactivate menu option in cj02

    Hi ,
    I need to deactivate the highlighted menu option from the tcode CJ02 , is it doable by Configuration   or any MENU exits available for this ? pls help
    Thanks,
    Chinnaiya

    I able to do it by creating transaction variant
    Thanks,
    Chinnaiya

  • Attachment list option from the GOS

    Hi freinds
    We have a custom Transaction for which we have activated the GOS icon on the screen. We have that icon and we care able to save the document to the Content repository fine.
    The issue is immediately after attaching the documents, if you use the
    " Attachment list" option from the GOS menu, it brings the attached documents.
    But if you leave the transaction and get in for the same document, the same function is not working.
    In what basis i have to save the document...
    Kindly pl throw in your ideas on this issue.
    Thanks
    deva

    Hi Kruthika,
    Here iam explaining how i resolved in my case
    i created a database table with the selection screen values
    if i attach any document in the GOS menu than keep a save button and write logic for save button to save the selection screen values in database table
    than after that if u see tha attachments again give another button like GET if u give any value which is in database tabel than press get it will get the all selcetion screen values and the attachmentts
    Note:Just iam explained what i did but i dont know what is ur requirement exactly
    if u come with ur requiremnt than we will help u
    Thanks
    Surendra

  • Jump menu from database

    I’m trying to create a “jump menu” from a
    database table.
    I’ve created the jump menu by using a "List/Menu" and a
    "Dynamic" connection, this displays the items correctly.
    Next I’ve used “Go To URL” and set the
    parameters for the page load to use the value of the List/Menu to
    load the required webpage and oppropriate value.
    The page loads however it doesn’t show (or use) the
    value from the List/Menu
    Any ideas?
    Heres my code
    <select name="selPRINT" id="selPRINT"
    onChange="MM_goToURL('parent','conPROD.asp?REF=<%=cStr(Request.Form("selPRINT"))%>');retu rn
    document.MM_returnValue">
    <option value="">Select your printer...</option>
    <%
    While (NOT rsPRODUCT.EOF)
    %>
    <option
    value="<%=(rsPRODUCT.Fields.Item("printDELLref").Value)%>"><%=(rsPRODUCT.Fields.Item("pri ntPRODUCT").Value)%></option>
    <%
    rsPRODUCT.MoveNext()
    Wend
    If (rsPRODUCT.CursorType > 0) Then
    rsPRODUCT.MoveFirst
    Else
    rsPRODUCT.Requery
    End If
    %>
    </select>

    I have the answer.
    First I created a list/menu and associated my database item
    to it.
    Next I created a jump-menu.
    I then used the database code from the list/menu and inserted
    it into the jump-menu.
    Finally I added the option value of the page I wanted to
    load.
    Here’s my final code…
    <select name="jumpMenu" class="SmallBLACK" id="jumpMenu"
    onChange="MM_jumpMenu('parent',this,0)">
    <option
    value="conPROD.asp?REF=<%=(rsP.Fields.Item("printDELLref").Value)%>">Select
    your printer....</option>
    <%
    While (NOT rsP.EOF)
    %>
    <option
    value="conPRINTdetail.asp?REF=<%=(rsP.Fields.Item("printDELLref").Value)%>"><%=(rsP.Field s.Item("printPRODUCT").Value)%></option>
    <%
    rsP.MoveNext()
    Wend
    If (rsP.CursorType > 0) Then
    rsP.MoveFirst
    Else
    rsP.Requery
    End If
    %>
    </select>

  • How do I pass a username form variable from a drop down list/menu to another page?

    Hi,
    I have a login_success.php page that has a drop down list/menu (which lists usernames). I want the user to click on their user name, and when they click the submit button the username information to be passed over to the username.php page which will contain a recordset, sorted by username.
    How do I pass the username info from the drop down list/menu to the username.php page?
    The drop down menu is connected to a recordset listUsername, I have filtered the recordset with the Form Variable = username, and I have used the POST method to send the username to the page username.php. I'm not sure how to structure the php or which page to place it on.
    <form id="form1" name="form1 method="post" action="username.php">
         <label for="username_id">choose username:</label>
         <select name="username_id" id-"username_id">
              <option value="1">username1</option>
              <option value="2">username2</option>
              <option value="3">username3</option>
              <option value="4">username4</option>
         </select>
         <input type="submit" name="send" id="send" value="Submit" />
         <input type="username" type="hidden" id="username" value="<?php echo $row_listUsername['username']; ?>" />
    </form>
    Could somebody help me please?
    Thanks.

    I would not post the variable over, In this case I personally would send it through the URL and use the $_GET method to retreve it. For Example.
    <html>
         <head>
              <title>Test Page</title>
              <script type="text/javascript">
                   function userID(){
                        //var ID = form1.userIDs.selectedIndex;
                        var user = form1.userIDs.options[form1.userIDs.selectedIndex].value;
                        window.location = "test.html?userID=" + user;
              </script>
         </head>
         <body>
              <form id="form1">
                   <select name="userIDs" id="userIDs" onchange="userID();">
                        <option>Select a User</option>
                        <option value="1">User 1</option>
                        <option value="2">User 2</option>
                        <option value="3">User 3</option>
                        <option value="4">User 4</option>
                   </select>
              </form>
         </body>
    </html>
    //PAGE TO RETRIEVE THE USERNAME
    <?php
    if(isset($_GET['userID'])
         $userID = $_GET['userID'];
         echo $userID;
         die;

  • How to gather option values from database in jsp

    jsp experts
    my problem is that i have to populate the optional values that user has to selecet his choice .
    we could have done it by :
    <optional value="item1">item1
    <optional value="item2">item2
    </select>
    but in our database if new category of item is enlisted then what ??? ,thats why we go for populating the values from fetching from database by simple class & populate values in the optional values.
    can any one help about it

    Hi Avina,
    You need to invoke a method from your jsp file which interacts with the database. If you are following the MVC pattern which segregates the View and Contoller part, invoke the controller jsp from your View using the include tag.
    Say this is the View.jsp
    // all your initial page include statements --
    <%
    // all your java code (if necessary)
    %>
    <jsp:include page="Controller.jsp" >
    <jsp:param name="command" value="getOptionList"/>
    </jsp:include>
    <!-- all your html tags -->
    // If you are following my technique, there should be a Controller.jsp which interacts with your database thru some class which you instantiate in this jsp, which invokes some method (that is why i have passed a parameter, so that if u want to make a check you can do so - u may or may not pass the parameters - based on ur requirements).
    Code in Controller.jsp:
    <%
    // MyClass is the class which does the querying into the database.
    // obj.getOptions() is a method in that class which returns a Vector
    // containing all the options from your database.
    // Please ensure that you import the package in this jsp file, so as
    // to get the MyClass.class in this jsp.
    String getWhat = request.getParameter("command");
    if ( getWhat != null && getWhat.equalsIgnoreCase("command") ) {
    MyClass obj = new MyClass();
    java.util.Vector optionsAvailable = obj.getOptions();
    session.setAttribute("Options", optionsAvailable);
    %>
    -------------- End of Controller.jsp related work ---------------
    // Returning back to the code in the View.jsp:
    Once the including is over, the control will return to the next line of code in View.jsp. Just retrieve the data from the session:
    Continued - View.jsp
    <select name="itemsInDB">
    <option value="Select"> Select </option>
    <%
    /* Now you have a vector containing all the options from
    your database. */
    java.util.Vector vecOptions = (java.util.Vector)
    session.getAttribute("Options");
    for (int i=0; i<vecOptions.size(); i++) {
    %>
    <option value="<%=vecOptions.elementAt(i)%>"><%=vecOptions.elementAt(i)%></option>
    <%
    %>
    </select>
    Well thats all thats required. Your problem is solved. You will get a list of all the options in your database. Happy Coding

Maybe you are looking for

  • Geting response on same JSP page

    hi everybody i want to select an item from dropdown box and want to display all data related with this selected item on same jsp page plz help me out thx in advance

  • New to mac and i cant set up mail account with yahoo plus...help please!

    hello,its my first post and im having all sorts of problems settting up my mail account even though ive upgraded to yahoo plus as recommended....i just dont understand the port numbers and pop,can anyone help please?

  • How to download films compatible with Final cut x

    Which program for downloading videos from internet I can use that is compatible with transporting videos to  Final Cut X .  I can download with fire fox but from Fire fox I can't import to the Final Cut X. Thank You

  • Whats the difference between wml & wml script???

    Whats the difference between wml & wml script??? Can anyone help me clear my doubts about this topic? And where can I find online tutorials on WML??? What are the softwares or programmes that i need to create wml??? Lastly, where can I download nokia

  • Adding new state, it is not blank. CS6

    when i create a new state some images from the first state appear on the stage and are locked and unselectable. I do not have a page set as master and all layers are unlocked. how do i create a blank state?