From database to drop down box

Hi all,
Suppose I have the following
String query ="Select name, number from Person";
I want to put all the "names" in a drop down box and all the "numbers" in a separate drop down box. When I do this:
while(rs.next()){
<select="person" onchange="showSelection">
<option value="<%=rs.getString("name")%>"><%=rs.getString("name")%></option></select>
I only get the value of the first name in my table. Can anyone help me?

Hi
I think you need to do some order. my suggestion is to create an Object that contains name and number like this:public class MyClass {
     String name;
     int number;
     public MyClass(String n,int num){
          setName(n);
          setNumber(num);
     //set and get methods for the data members...
}next, roll over the ResultSet and create MyClass object each time and add it to a Vector or something like that. usually a drop down box displays many times and it will be very bad if you will query the data base each time you want to display it, thats why i suggest you to save this Vector in a bean or somewhere else (of course, if the data is static).
than display the vector content like this:<select name="person" onchange="showSelection">
<%     Enumeration e=vec.elements();
     while(e.hasMoreElements()){
          MyClass m=(MyClass)e.nextElement();
%>          <option value="<%=m.getName();%>"><%=m.getName();%></option>
<%     }%>
</select>
<%     e=vec.elements();
%><select name="number" onchange="showSelection">
<%     while(vec.hasNext()){
          MyClass m=(MyClass)vec.next();
%>          <option value="<%=m.getNumber();%>"><%=m.getNumber();%></option>
<%     }%>
</select>pay attention on how you wrote the select tag: <select="person"...
and not: <select name="person"...
hope it helps
mamtz
BTW
think of using struts and custom tags in jsp it will much easier to do this!!!

Similar Messages

  • Since upgrading to Firefox 4 I've been unable to select search items from the google drop down box in the toolbar. Instead, I have to retype my search item completely as I also unable to select 'auto-complete' items as they appear.

    Since upgrading to Firefox 4 I've been unable to select search items from the google drop down box in the toolbar. Instead, I have to retype my search item completely as I also unable to select 'auto-complete' items as they appear.

    Known problem with the Google Toolbar extension. <br />
    http://www.google.com/support/toolbar/bin/static.py?page=known_issues.cs

  • How to get values from a multiple drop-down box.

    On my first page, I have a multiple drop-down box as the following code.
    <select name="selInterMethod" class="textbox" multiple>
    <option selected value="CH">Chicago</option>
    <option value="NY">New York</option>
    <option value="SF">San Francisco</option>
    </select>
    On my second transaction page, I need to save "CH-NY" into my Database column: city if the user selected Chicago and New York.
    How can I accomplish this in JSP?
    Thanks for your help.

    I figured out the solution. Here it is. FYI
    String inter_method = "";
    String Inter_Method[]=request.getParameterValues("selInterMethod");
         if( Inter_Method.length > 0 ) {
              for (int i = 0; i < Inter_Method.length; i++) {
                   inter_method = inter_method + '-' +Inter_Method;
              inter_method = inter_method.substring(1,inter_method.length());
              System.out.println("trx inter_method = " + inter_method);

  • How to display information from database using drop down list in JSP?

    Hi all.
    Like the tile above suggest, I'm having difficulty in obtaining the data as well as displaying them in a drop down list.
    For example: If i were to have the following in my database:
    SerialNo Food
    1 Bread
    2 Milk
    3 Butter
    The drop down list should look like the following:
    [Bread][\/]
    [Milk]
    [Butter]
    How do i go around coding it in JSP?
    Thanks in advance.
    C.K

    Hai Please try the following code
    You have to make some changes according to your system i am using
    MSSqlserver Driver change the class name and the connection string
    for your need
    <HTML>
    <HEAD>
    <%@ page language="java" import="java.sql.*"%>
    <LINK href="../theme/Master.css" rel="stylesheet" type="text/css">
    <TITLE>ListDrop.jsp</TITLE>
    <%!Connection con;
         %>
    </HEAD>
    <BODY>
    <select>
         <%
              try {
                   Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");\\Here you specify the Class Nale
                   con = DriverManager
                             .getConnection(
                                       "jdbc:microsoft:sqlserver://javaserver:1433;DatabaseName=karthi",
                                       "sa", "sa");\\here Connection string
                   ResultSet rs;
                   Statement st = con.createStatement();
                   rs = st.executeQuery("select SerialNo,Food from Foods");
                   while (rs.next()) {
    %>
         <option value='<%= rs.getString("SerialNo") %>'><%= rs.getString("Food")%></option>
         <%
              } catch (Exception e) {
                   e.printStackTrace();
    %>
    </select>
    </BODY>
    </HTML>

  • Update variable value from Web Item Drop Down Box

    Hi Experts,
    My issue is that i have dropdown on Characteristic 0EMPLOYEE so when ever the user enter the template restricting with a costcenter then the the list of employee will be displayed but when user restricts the template view to a employee using the dropdown then can we pass the employee restricted in dropdown box to a variable in Planning function.
    Regards,
    Raj

    Hi Raj,
    You can do the following.
    1. Create a filter on your aggregate level. Add 0Employee to the filter. Create an user input variable (ZV_EMPLOYEE) on 0Employee which will be used to hold the values entered by the user.
    2. Assing the above created variable to the 0employee in filter.
    3. In the planning function (FOX), create a local variable for 0Employee . Eg. DATA VAR_EMPLOYEE TYPE 0EMPLOYEE.
    4. Assign the variable value passed by user to this local variable in FOX
    VAR_EMPLOYEE  = VARV(ZV_EMPLOYEE).
    5. If the employee count is more use FOREACH statement in the FOX. like FOREACH VAR_EMPLOYEE.
    6. Creat a planning sequence which will have the same filter and the function.
    7. You can also use the same filter in your plan query as well, so that the data set remains same.
    This will solve your problem. Please writ back in case any clarification is required..
    Regards, Rishi

  • Fetching values from database into a drop down box

    in my JSP page there are 3 drop down boxes for date of birth......
    what i need is i want to get the values from database into that drop down box when i access the JSP page.......
    session is there....'m getting all other values.......
    I will attach the JSP page.....
    Please help me...........
    Thanks in Advance......
    <%@ taglib uri='/WEB-INF/taglib/struts-bean.tld' prefix='bean'%>
    <%@ taglib uri='/WEB-INF/taglib/struts-logic.tld' prefix='logic'%>
    <%@ taglib uri='/WEB-INF/taglib/dyna.tld' prefix='dyna'%>
    <%@ taglib uri='/WEB-INF/taglib/struts-html.tld' prefix='html'%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><bean:message key="page_title"/></title>
    <link href="<bean:message key="context"/>/CSS/default.css" rel="stylesheet" type="text/css" />
    <script src="<bean:message key="context"/>/js/AC_RunActiveContent.js" type="text/javascript"></script>
    <link href="<bean:message key="context"/>/CSS/screen.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <%!
    Membership mShip = null;
    %>
    <script language="javascript" >
    function checkDate(Form){
    var d;
    d = Form.year.value+"-"+Form.month.value+"-"+Form.day.value;
    alert("Date is:"+d);
    Form.dob.value = d;
    </script>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>
         <jsp:include flush="true" page="../templates/header.jsp"/>     </td>
    </tr>
    <tr>
    <td class="menuTD">     
         <jsp:include flush="true" page="../templates/menu.jsp"/>     </td>
    </tr>
    <tr>
    <td class="sub_menuTR"> </td>
    </tr>
    <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td class="column" valign="top" width="170"><jsp:include flush="true" page="../templates/left_panel.jsp"/></td>
    <td valign="top" align="left">
              <dyna:message error="error" warning="warning" message="message"/>
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td width="80%" valign="top" align="left">
                   <%
                   if(session != null){
                   mShip = (Membership)session.getAttribute("member");
                   %>
                        <form action="updateContactDetails.dy" method="post" name="form1">
                        <input type="hidden" name="m" value="<%=request.getParameter("m")%>" />
                             <table width="100%" border="0">
                             <tr>
                                  <td>First Name</td>
                                  <td><input name="first_name" type="text" id= "first_name" value = "<bean:write name = "member" property = "first_name" />" /></td>
                             </tr>
                             <tr>
                                  <td>Last Name </td>
                                  <td><input name="last_name" type="text" id="last_name" value = "<bean:write name = "member" property = "last_name" />" > </td>
                             </tr>
                             <tr>
                                  <td>Address</td>
                                  <td><input name="address1" type="text" id="address1" value = "<bean:write name = "member" property = "address1" />" ></td>
                             </tr>
                             <tr>
                                  <td> </td>
                                  <td><input name="address2" type="text" id="address2" value = "<bean:write name = "member" property = "address2" />" ></td>
                             </tr>
                             <tr>
                                  <td>Suburb/City </td>
                                  <td><input name="city" type="text" id="city" value= "<bean:write name = "member" property = "city" />" ></td>
                             </tr>
                             <tr>
                                  <td>State/Territory</td>
                                  <td><input type="text" name="state" value = "<bean:write name = "member" property = "state" />" ></td>
                             </tr>
                             <tr>
                                  <td>Postcode</td>
                                  <td><input type="text" name="postcode" value = "<bean:write name = "member" property = "postcode" />" ></td>
                             </tr>
                             <tr>
                                  <td>Contact Phone</td>
                                  <td><input type="text" name="home_phone" value = "<bean:write name = "member" property = "home_phone" />" ></td>
                             </tr>
                             <tr>
                                  <td>Mobile</td>
                                  <td><input type="text" name="mobile" value = "<bean:write name = "member" property = "mobile" />" ></td>
                             </tr>
                             <tr>
                                  <td>Date of birth</td>
                                  <td nowrap="nowrap"><select name="day">
    <option>Day</option>
    <option value="01">1</option>
    <option value="02">2</option>
    <option value="03">3</option>
    <option value="04">4</option>
    <option value="05">5</option>
    <option value="06">6</option>
    <option value="07">7</option>
    <option value="08">8</option>
    <option value="09">9</option>
    <option value="10">10</option>
    <option value="11">11</option>
    <option value="12">12</option>
    <option value="13">13</option>
    <option value="14">14</option>
    <option value="15">15</option>
    <option value="16">16</option>
    <option value="17">17</option>
    <option value="18">18</option>
    <option value="19">19</option>
    <option value="20">20</option>
    <option value="21">21</option>
    <option value="22">22</option>
    <option value="23">23</option>
    <option value="24">24</option>
    <option value="25">25</option>
    <option value="26">26</option>
    <option value="27">27</option>
    <option value="28">28</option>
    <option value="29">29</option>
    <option value="30">30</option>
    <option value="31">31</option>
    </select>
                                  <select name="month">
                                       <option>Month</option>
                                       <option value="01">January</option>
                                       <option value="02">February</option>
                                       <option value="03">March</option>
                                       <option value="04">April</option>
                                       <option value="05">May</option>
                                       <option value="06">June</option>
                                       <option value="07">July</option>
                                       <option value="08">August</option>
                                       <option value="09">September</option>
                                       <option value="10">October</option>
                                       <option value="11">November</option>
                                       <option value="12">Decembber</option>
                                  </select>
                                       <select name="year" onChange = "checkDate(this.form);" >
                                       <option>Year</option>
                                       <option value="1957">1957</option>
                                       <option value="1956">1956</option>
                                       <option value="1955">1955</option>
                                       <option value="1954">1954</option>
                                       <option value="1955">1955</option>
                                       <option value="1956">1956</option>
                                       <option value="1957">1957</option>
                                       <option value="1958">1958</option>
                                       <option value="1959">1959</option>
                                       <option value="1960">1960</option>
                                       <option value="1961">1961</option>
                                       <option value="1962">1962</option>
                                       <option value="1963">1963</option>
                                       <option value="1964">1964</option>
                                       <option value="1965">1965</option>
                                       <option value="1966">1966</option>
                                       <option value="1967">1967</option>
                                       <option value="1968">1968</option>
                                       <option value="1969">1969</option>
                                       <option value="1970">1970</option>
                                       <option value="1971">1971</option>
                                       <option value="1972">1972</option>
                                       <option value="1973">1973</option>
                                       <option value="1974">1974</option>
                                       <option value="1975">1975</option>
                                       <option value="1976">1976</option>
                                       <option value="1977">1977</option>
                                       <option value="1978">1978</option>
                                       <option value="1979">1979</option>
                                       <option value="1980">1980</option>
                                       <option value="1981">1981</option>
                                       <option value="1982">1982</option>
                                       <option value="1983">1983</option>
                                       <option value="1984">1984</option>
                                       <option value="1985">1985</option>
                                       <option value="1986">1986</option>
                                       <option value="1987">1987</option>
                                       <option value="1988">1988</option>
                                       <option value="1989">1989</option>
                                       <option value="1990">1990</option>
                                       <option value="1991">1991</option>
                                       <option value="1992">1992</option>
                                       <option value="1993">1993</option>
                                       <option value="1994">1994</option>
                                       <option value="1995">1995</option>
                                       <option value="1996">1996</option>
                                       <option value="1997">1997</option>
                                       <option value="1998">1998</option>
                                       <option value="1999">1999</option>
                                       <option value="2000">2000</option>
                                       <option value="2001">2001</option>
                                       <option value="2002">2002</option>
                                       <option value="2003">2003</option>
                                       <option value="2004">2004</option>
                                       <option value="2005">2005</option>
                                       <option value="2006">2006</option>
                                       <option value="2007">2007</option>
                             </select ></td></tr>
                             <tr>
                                  <td><input type="hidden" name = "dob" /> </td>
                                  <td nowrap="nowrap"><input type="submit" value="Submit" /></td>
                             </tr>
                             </table>
                        </form>
                   </td>
    <td width="40"></td>
    <td width="200" valign="top">
                   <div id="headlines">
    <jsp:include flush="true" page="../templates/profile.jsp"/>
    </div>
                   </td>
    </tr>
    </table>
              </td>
    <td> </td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><jsp:include flush="true" page="../templates/footer.jsp"/></td>
    </tr>
    </table>
    </body>
    </html>

    i think normally u will get data from databsae as objects.they are like java beans having getter and setter methods.so you create a collection of those objects like collect all the objects coming from database into an arraylist or....
    suppose you want to populate the dropdown box with say "username" from database object s, your code will look like that
    <html:select property="name">
    <html:options collection="databaseList" property="username" />
    </html:select>
    "databaseList" is collection(say.. ArrayList) of objects you are getting from database.this dropdown will contain all the "usernames" you are getting from database.

  • The 'Third Party Connections' drop down box on the 'Source Database' step in the Migration Wizard is empty.

    Here are the environmental details:  
    SQLDeveloper 32-bit Version 3.2.20.09 (Build MAIN-09.87)
    Oracle Database:  12C single instance (no RAC)
    Oracle client:  12C 32 bit
    Windows 64 bit desktop
    I am attempting to migrate an MS Access application to Oracle.  I pick the ‘Migrate’ selection from the ‘Tools’ Menu SQL Developer.  This puts me into the Migration Wizard.  When I get to the ‘Source Database’ step of the migration wizard, the ‘Choose the Third Party database from which you are migrating’  drop-down box is not being populated with the current available connections. It is empty.  If I type a valid connection name into the box, SQL Developer takes it on this screen but does not keep it for the next screen/step.  It has no persistence.  I even tried to make sure that each connection was open/connected before beginning the migration process.
    Due to the fact that I am attempting to migrate an MSAccess application, I am mixing 32-bit and 64 bit software.  This may be the issue as to why the drop down is losing addressability.  I have not applied any patches to this version of SQL Developer.

    Hi,
    If you need easy way to migrate Microsoft Access to Oracle probably it is more reasonable to review some tools specially designed to this purpose. For example:
    Access to Oracle converter by Intelligent Converters
    Access to Oracle converter by SpectralCore
    Access to Oracle converter by Interface Computers
    Hope, this will help.
    Sincerely,
    Vlad

  • Populating drop-down box from Server XML

    Hello all,
    I'm working on a REST - Lightroom interface, which I'm going to document as expose as a way for anyone to upload pictures to their site.
    Anyway, I need to populate a drop-down with the story names and ids from this XML. Any ideas? I'm a top actionscripter/ruby/etc, but not too familiar with Lua. Looks good though.
    1
    2
    Hope someone can help :)

    Hi there,
    I'm also facing an identical problem and would also like the solution. I've thought about using JavaScript in conjunction with JSP to populate the second drop down box dynamically. But first I need to retrieve the values in the first drop down box from a database and subsequently the 2nd drop down box - I'm thinking that a for loop needs to be used somehow. amishpg, I will let you know If I'm successful.
    Assad

  • Hebrew fonts from drop-down box not displaying in text box.

    I am using InDesign CS 5.5 on a Mac 10.8.4.
    When in ID, the fonts I am seeing on the Font dropdown menu when I try to use in a text box are not displaying correctly. They only display as boxes. The fonts are in the Hebrew language. They are properly installed in the FontBook.
    Please help!! Thank you.

    Reema,
    I followed most of your steps. I have a question reg. step 3 ie populating data in node 1.
    Here is my code:
    method WDDOINIT .
    types: begin of zs,
    zktokd type kna1-ktokd,
    end of zs.
    data: handle1 type ref to if_wd_context_node,
    begin of zstruct,
    zktokd type kna1-ktokd,
    end of zstruct,
    zitab type table of zs.
    handle1 = wd_context->get_child_node( name = 'NODE1' ).
    *select ktokd into corresponding fields of zstruct from kna1.
    *append zstruct to zitab.
    *endselect.
    zstruct-zktokd = 'Sold-to party'.
    append zstruct to zitab.
    zstruct-zktokd = 'Goods recipient'.
    append zstruct to zitab.
    zstruct-zktokd = 'Payer'.
    append zstruct to zitab.
    zstruct-zktokd = 'Bill-to party'.
    append zstruct to zitab.
    zstruct-zktokd = 'Prospective Customer'.
    append zstruct to zitab.
    zstruct-zktokd = 'Competitor'.
    append zstruct to zitab.
    zstruct-zktokd = 'Sales partners'.
    append zstruct to zitab.
    zstruct-zktokd = 'Hierarchy Node'.
    append zstruct to zitab.
    zstruct-zktokd = 'Named List of Accounts'.
    append zstruct to zitab.
    zstruct-zktokd = 'Distribution center'.
    append zstruct to zitab.
    zstruct-zktokd = 'Payer'.
    append zstruct to zitab.
    handle1->bind_table( new_items = zitab ).
    endmethod.
    Please let me know if this is the best way to populate the node and then bind the table values from the node to the drop down box.
    Thanks and Regards.

  • How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    How can I remove a mailbox address from the "From" drop down box in a new e-mail my old e-mail address continue to populate as the sender address

    Hello,
    Try Mail>Preferences>Accounts icon>Account Information tab>Click on the Outgoing SMTP server drop down, choose edit Server list, highlight the old one & click Remove.
    (Such convolution is worthy of Windows® in my estimation)

  • How to Change a Default Value from Drop Down Box displayed in Web Dynpro?

    Hi,
    How to Change a Default Value from 'High' to 'Low'  in a Drop Down Box for RANGE field displayed in Standard Web Dynpro Component.  I saw a Default Value set for a RANGE field  in View Context When I select that field and click on Display. I am seeing Default Value set it to 'HI'. Please let me know how to change from HIgh to Low.
    I appreciate your help!
    Thanks,
    Monica

    hi,
    use the set_attribute( ) method now to set the attribute with a particular key eg HIGH in ur case
    // u can use the code wizard( control +f7) this code will be auto generated when u select the
    //radio button to read the context node
    DATA lo_nd_cn_node TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_node TYPE REF TO if_wd_context_element.
      DATA ls_cn_node TYPE wd_this->element_cn_node.
    * navigate from <CONTEXT> to <CN_NODE> via lead selection
      lo_nd_cn_node = wd_context->get_child_node( name = wd_this->wdctx_cn_node ).
    * get element via lead selection
      lo_el_cn_node = lo_nd_cn_node->get_element(  ).
    * set single attribute
      lo_el_cn_node->set_attribute(
          name =  `ATTribute name.`
          value = 'LOW' ).
    it will solve ur query ..
    also refer to this component
    wdr_test_events -> view dropdownbyidx and dropdownbykey ->method name onactionselect.
    regards,
    amit

  • I have version 3.6.16 and when I login to my hotmail account, and type the first letter of the email address, a drop down box appears with my hotmail address and I can choose it from that box with a click. How do I get version 4 to do this? Thanks.

    I have version 3.6.16 and when I login to my hotmail account, and type the first letter of the email address, a drop down box appears with my hotmail address and I can choose it from that box with a click.
    How do I get version 4 to do this?
    Thanks.

    The new but not-ready-for-prime-time autocomplete method searches for matches that contain the entered text, not just ones that begin with the string. Your options are:
    1) type in longer strings that narrow the search
    2) use an add-on to search just the beginnings:
    https://support.mozilla.org/en-US/questions/1037469
    3) install an older version of TB:
    http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/

  • Unable to delete photos from  my desktop , I get a drop down box with continued blue/ white bars - now 6 hours

    Having dragged 8 photos onto my desktop from iphoto  for the purpose of easy addition to an email , I now find that when I  dragged them to the Trash bin , they fail to delete.
    I get a drop down box with continued blue/ white bars , stating "moving to trash " .
    It's now  6 hours and I cannot stop either. Tried to shut down my computer and reboot but it won't let me . I tried  turning the power off , but the problem remains .
    Any help would be welcome.

    Hey ! 
    I have found the solution myself  !!!
    Go ..... Apple in the toolbar - Force quite - select finder - then relaunch .
    Brilliant

  • Getting the value from a Drop Down Box

    I'm working on a database project to keep track of our Blackberrys. The problem I'm having is entering the values for two drop down boxes. The page I'm working on enters the FirstName, LastName, Department, and Location. Department and Location have thier own Primary Keys and are foreign keys in the Person table. Departments and Locations are aligned by numbers like 1 = Ohio, 2 = Chicago. They
    don't automatically increase. The problem I'm having is entering them as a foreign key in the Person Table. I'm not sure if I use a getValue or getSelected or some other code to get the values to populate in the Person Table. I just keep getting a can't add department or location to table.
    public String newUser_action() {
    // TODO: Process the button click action. Return value is a navigation
    // case name where null will return to the same page.
    if (personDataProvider.canAppendRow()) {
    try {
    RowKey rowKey =
    personDataProvider.appendRow();
    personDataProvider.setValue(
    "DBO.PERSON.FIRSTNAME", rowKey,
    firstName.getText());
    personDataProvider.setValue(
    "DBO.PERSON.LASTNAME", rowKey,
    lastName.getText());
    personDataProvider.setValue(
    "DBO.PERSON.DEPTID", rowKey,
    department.getSelected());
    personDataProvider.setValue(
    "DBO.PERSON.LOCATIONID", rowKey,
    location.getSelected());
    personDataProvider.setValue(
    "DBO.PERSON.BEGINDATE", rowKey,
    newDate.getText());
    //personDataProvider.setValue(
    "DBO.PERSONDEVICE.AQUIREDATE", rowKey,
    newDate.getText());
    personDataProvider.commitChanges();
    info("New User " + newUser.getText() +
    " added to USER table");
    newUser.setText(null);
    } catch (Exception e) {
    log("Cannot add new User ", e);
    error("Cannot add new User: " +
    e.getMessage());
    } else {
    log("Cannot append new User");
    error("Cannot append new User");
    return null;
    }

    Sun's databound components tutorial may prove helpful to you.

  • I was trying to figure out how to stop my pinned apps from disappearing after I've shut-down my computer during storms. In the process of trying things I lost the Orange Firefox drop down box in the upper left corner. How do I get it back?

    Question 1 - How do I restore the Orange Firefox drop-down box that was originally at the top of the screen.
    Question 2 - How do I undo the last command I changed
    Question 3 - How do I prevent my pinned apps from disappearing. I have about 10 loaded and it's a pain to have to reload those several days a week. Seems to only happen if I shut down the computer.

    You see the orange (on Linux gray) Firefox button if the Menu Bar is hidden.
    *View > Toolbars > Customize
    *Right-click a toolbar).
    *Press F10 or tap the Alt key to bring up the "Menu Bar" temporarily if the Menu Bar is hidden.
    Make sure that you do not use "Clear Recent History" to clear the "Browsing History" when Firefox is closed because that prevails and prevents Firefox from opening tabs from the previous session.
    * https://support.mozilla.com/kb/Clear+Recent+History
    What do you mean with Question 2: ''How do I undo the last command I changed'' ?
    Which last command are you referring to?

Maybe you are looking for