Dynamic select list: link to another page

Hi
Have following dynamic select list at the bottom in "product.php" page (www.dolls.com.sg)
<div id="selectcat">
  <select name="Categories">
    <?php
do { 
?>
    <option value="<?php echo $row_rsCategories['categoryName']?>"<?php if (!(strcmp($row_rsCategories['categoryName'], $row_rsCategories['categoryName']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsCategories['categoryName']?></option>
    <?php
} while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
  $rows = mysql_num_rows($rsCategories);
  if($rows > 0) {
      mysql_data_seek($rsCategories, 0);
   $row_rsCategories = mysql_fetch_assoc($rsCategories);
?>
  </select>
My target is, whenever a visitor clicks on a category in the pull down menu, he is forwarded to the respective "categories.php" page.
How can I do that?
Thanks
Helmut

Change your code to this:
<div id="selectcat">
<form method="get" action="categories.php">
  <select name="Categories">
    <?php
do { 
?>
    <option value="<?php echo $row_rsCategories['categoryName']?>">
    <?php echo $row_rsCategories['categoryName']?></option>
    <?php
} while ($row_rsCategories = mysql_fetch_assoc($rsCategories));
  $rows = mysql_num_rows($rsCategories);
  if($rows > 0) {
      mysql_data_seek($rsCategories, 0);
   $row_rsCategories = mysql_fetch_assoc($rsCategories);
?>
  </select>
  <input type="submit" value="View Dolls">
</form>
</div>
In categories.php, use $_GET['Categories'] to filter the recordset.

Similar Messages

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • Default value dynamic select list

    Hi everybody,
    I have a question concerning dynamic select lists.
    I have a report of a table that shows some records. Each record has different versions of data. So when you click on a record you get to another page where you get some information about this record and where you can select the version of this information (with the help of a select list).
    The select list works fine and is defined dynamically as follows:
    select distinct a.name display_value,
    a.version_id return_value
    from cn_pl_version a,
    cn_pl_std_peplanung b
    WHERE a.version_ID = b.version_id AND
    b.pe_id = '&P6_HELP_PRODET.'
    order by a.version_id desc
    My problem is that when I click on a record I always get the report filled with the oldest version of the current record, so I always have to choose the newest version in the select list manually. I would prefer always to have the newest version in the report.
    The query for the report is as follows:
    select
    (select sum(stunden) from cn_pl_std_peplanung t02
    where abt_id = '10'
    and t02.pe_id = t1.pe_id
    and t02.version_id = t1.version_id
    and t02.idee_id = t1.idee_id) stunden_ir,
    (select name from cn_pl_version u01
    where u01.version_id = t1.version_id) Version
    from cn_pl_std_peplanung t1, cn_pl_projektelemente z1, cn_pl_version u1, cn_pl_projektidee s1
    where t1.version_id = '&P6_VERSION_WAHL.'
    and t1.pe_id = z1.pe_id
    and z1.pe_id='&P6_HELP_PRODET.'
    group by t1.pe_id, t1.version_id, t1.idee_id
    '&P6_VERSION_WAHL.' is the item of the select list
    '&P6_HELP_PRODET.' is the ID of the current record
    I'm not sure if you understood my problem, my english isn't the best...
    Thanks for any kind of help!!
    Patrick

    Hi Patrick,
    what value does you select list show, when you branch to the page? Is it the correct one?
    If not you should change your select list, that the correct version is selected as default. You can define a "default value" when you set the source of the element.
    Otherwise you can maybe set up an example application at http://apex.oracle.com.
    Best Regards
    chrissy

  • Dynamic select list with one static 'not_listed" option

    Hi guys,
    I want to create a dynamic select list with one static 'not_listed' option.
    One possible alternative is to add the 'not_listed' record into database, but I really dont want to go that way unless there is no other way around.
    Can anyone shed some lights on this?
    Many thanks,
    William

    As usual : "It depends"...
    If you have a foreign key defined on that field, Scott's reply won't work - unless you define '0 - Not listed' in the database. You can use selec 'not listed' d, to_number(null) r from dual though...
    Another - more declarative way - is in the on 'Edit Page Item' page, in the 'List of Values' region set 'Display Null' to 'Yes' and 'Null Display Value' to ' - Not listed - '.
    Roel

  • Calendar Day Link to Another Page

    I have a Page which has Date as LOV with Submit With Select (This is Page 10)
    e.g. User selects a date, report is displayed based on date selected. This is done using Select list with Submit. Date is populated using LOV based on query. The default value of date is Maximum of date in on of my date column.
    The above think works great. No problem so far.
    I want to create calendar view which is another page (This is Page 20) .
    Calendar is created using Calendar wizard. In Calendar, I want to link Day to above Page. I can create day link which links back to Page 10 and also report data is displayed based on date selected in Calendar.
    Now, the problem: The problem is value of Date field on above page (Page 10) is always set to default value. Although, I have said that default value should only set when session state is NULL.
    So my question is why Date (Display value) is not set to value passed from Calendar Page. I have checked Session info and correct value of date is present.
    What should I do to correct this problem ?
    The other question is :
    How to disable calendar day link when there is no data to be displayed ? At present, as soon as I create a Day link, all the Days in Calendar are linked, what I want is, to hightlight/clickable which has only some data.
    How should I do this ?
    Thanks
    Sanjay

    Sanjay,
    Instead of using the Day Link feature, you can create a link in the SQL query for the calendar region. This will accomplish both of your goals: It will pass the value to your other page, and it will only appear for days where there is a value.
    If you look at the Orders page of the sample application, you'll see that the SQL for the calendar is :
    select '<a title="Order Detail" href="f?p=&APP_ID.:29:' || :APP_SESSION || '::::P29_ORDER_ID:' || order_id || '">' || to_char(order_total, '$999,999') || '</a>
    ' ord, order_timestamp
    from demo_orders o, demo_users u
    where o.user_id = u.user_id and (u.user_name = :APP_USER
    or :APP_USER = 'ADMIN')
    The query returns two columns: The value to display, and a date. In this case, the value to display is a link to another page. The link passes a value for the P29_ORDER_ID value.
    Documentation for the link syntax is available here: http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10992/mvl_fund.htm#sthref446

  • Dynamic select list crashes with php

    HI All,
    I can't seem to get a dynamic select list to work in
    dreamweaver. It completly crashes everytime I try adding it to my
    page. I found someone else in the forum who had the same problem
    but no one ever responded. I've tried several things including
    putting just the record set and dynamic select on it's own page
    with no other code on it. It still crashes DW. I also tried coding
    it myself by making a listmenu and modifying it so that the option
    value equals a PHP echo of a value. It crashed there too. Does
    anyone have a piece of code with a working dynamic select list that
    uses a record set that I could look at? That way I can see where
    I'm going wrong. All I'm trying to do is get a simple drop down
    select list of employee names so someone can choose their name to
    get commission. It's a one table, 2 fields (first & last name)
    record set.
    Using DW CS3, php & MySQL.,windows XP Pro
    Any help would be really appreciated!

    AthroughZ wrote:
    > I can't seem to get a dynamic select list to work in
    dreamweaver. It
    > completly crashes everytime I try adding it to my page.
    It looks as though you have a corrupt cache file. Follow
    troubleshooting
    step 4 in the following technote:
    http://www.adobe.com/go/tn_19105
    David Powers, Adobe Community Expert
    Author, "The Essential Guide to Dreamweaver CS4",
    "PHP Solutions" & "PHP Object-Oriented Solutions"
    http://foundationphp.com/

  • Dynamic select list dependency

    Hello,
    I want to have two select lists populated dynamically by a query, where contents of one list depend on the choice made in the other list.
    For example I have tables CATEGORY (ID, NAME) and SUBCATEGORY (ID, NAME, CAT_ID). I created one List of Values that Category select list is based on: "select name d, id r from category order by 1". This alone works fine.
    Now for Subcategory select list I created another List of Values: "select name d, id r from subcategory where cat_id = :CAT_ID order by 1". The where clause is just my guess and it doesn't work (select list is empty). How do I pass the value selected in my first select list as a parameter for the second one?
    Nikolai

    can you take a look to my response to the second question at...
    Pop List and Developer Toolbar
    ...and let us know if you have any questions?
    thanks,
    raj

  • Creating dynamic select list

    I have a dynamic select list populated by site names and URLs from a map; when a user clicks on an entry the site name and URL will fill two text boxes. There are also buttons to add, update, and delete entries. These buttons lead to actions within my JPF file.
              When I select an entry to delete, the script runs a delete SQL statement again my Ora db instance, then the page content is repopulated. I want to know how come when I do that I always get the sequence ID of the just deleted entry at the end of my select list.
              Here is a snippet of what I've got:
              JSP:
                        <netui:select
                dataSource="{actionForm.siteList[0]}"
                optionsDataSource="{actionForm.itemOptions}"
                size="4"
                tagId="siteList">
              <netui:textBox
                dataSource="{actionForm.title}"
                size="30" maxlength="200" tagId="title"/>
              <netui:textBox
                dataSource="{actionForm.url}"
                size="30" maxlength="200" tagId="url"/>
              <netui:hidden dataSource="{actionForm.key}"
                tagId="key"/>
              <script language="javascript">
                <!--
                <%=session.getAttribute("jsArray")%>
                  function siteClicked()
                    var index =
                      document[getNetuiTagName("process",this)]
                      [getNetuiTagName("siteList",this)][
                        document[getNetuiTagName("process",this)]
                        [getNetuiTagName("siteList",this)]
                        .selectedIndex]
                      .value
                    document[getNetuiTagName("process",this)]
                    [getNetuiTagName("key",this)].value
                      = index;
                    document[getNetuiTagName("process",this)]
                    [getNetuiTagName("title",this)].value
                      = siteArray[ index ][0];
                    document[getNetuiTagName("process",this)]
                    [getNetuiTagName("url",this)].value
                      = siteArray[ index ][1];
                -->
              </script>
                                  JPF:
                        Connection conn = null;
              query = "delete from stlnt_other_ref_sites " +
                      "where stlnt_ors_site_id = " + form.getKey();
              try {
                pstmt = conn.prepareStatement( query );
                pstmt.executeUpdate();
              } catch (SQLException ex) {
              try {
                Map map = new LinkedHashMap();
                while ( rs.next() )
                  map.put(new Integer(rs.getInt(1)), rs.getString(2));
                  jsArray += "siteArray[" + rs.getInt(1)
                    + "]=new Array(\"" + rs.getString(2)
                    + "\",\"" + rs.getString(3) + "\");";
                  hasResults = true;
                options = map;
                getSession().setAttribute("jsArray",jsArray);
                getSession().setAttribute("hasResults",
                  String.valueOf(hasResults));
              } catch (SQLException ex) {
              

    OK I got it working... Mostly... I don't know if it was a combination of changes that made the difference, but I'll put down what I did. First, I switched my select object in the form bean into just a string type from a string array (it was allowing the selection of one entry anyways). Second, rather than just blanking out the options map, I also blanked out the select object [eg form.setSelect("")].
              Now when I select an entry and click delete, the resulting select list is short one visible element. However, you can still select the blank spot where that last entry used to be. However, this is not a huge issue for me now; I will investigate this at a later time.

  • Select List with Submit refreshes page to top force users to scroll down

    Hello All,
    I have Dependent Select List where this functionality driving select list submit values to a subsequent select list.
    The "Select List with Submit" refreshes page where the unintended by-product is page refresh, which returns to top of page and therefore force users to scroll back down.
    In other words: I have a long form page where I have a Dependent Select List. So when you change the value of the 1st select list it refreshes the 2nd. This is all fine, but when the refresh occurs, the Form-focus returns to the top of page. This makes the users scroll back down to the lower end of the Form where they left off. This would make usability problems for users.
    Anyway we can make the Form return where to the area(Item or Region) where the user was during the selection of the Select List?
    Thanks in advance,
    Konstantine

    HURRAY!! I got it to work perfectly using anchors. I am adding this message to help future ApEx developers.
    I have been searching the Forum for 3 days and have read numerous postings. There was a lot of good discussion on anchors and linking from page to page. But, nothing exactly like my situation.
    Situation: Have a page, PG4, with a button, PG4_BUTTON, that redirects to a different page, PG7. PG4_BUTTON has its 'Display In Region' field set to PG4_REGION. When PG4 is run and the form displays, the PG4_BUTTON is located at the bottom. When the user would click PG4_BUTTON, the user would be taken to PG7. (this is good) The user enters some data in PG7 fields and then clicks a create button, PG7_BUTTON. PG7_BUTTON would submit data. An After Processing, Go To Page, Branch would be activated when this button was pressed and then the user would be returned to a refreshed PG4, at the top. This forces the user each time to have to scroll down to the bottom of PG4 to continue. (this is NOT good)
    Solution: On PG4, I edited the region, PG4_REGION. For the region 'Title' I added an anchor before the actual name. So it looked like this:
    {a name="REGION_TO_RETURN_TO"></a}PG4_REGION
    please note: where I have the curly braces above '{' '}' you need to put < the pointed and '>'
    Next, on PG7, I edited the Branch. On the 'Edit Branch' page, in the 'Action' region, I changed the 'Target type' field from 'Page in this Application' to 'URL'.
    To the 'URL Target' text area field I added this:
    f?p=&APP_ID.:4:&SESSION.::::::#REGION_TO_RETURN_TO
    So, there you have it. If you still need to read other postings, here are a couple of the sites I read:
    Re: Lists that go to items
    Re: URL target on a button.  What is the syntax??
    How to use <a name="top">Hello I'm at the top </a> tags in apex url ?
    Re: anchor or go to item from a branch
    http://www.oracle.com/technology/products/database/application_express/howtos/howto_navigate_in_a_page-1.6.html
    http://www.echoecho.com/htmllinks.htm
    http://www.htmlcodetutorial.com/linking/linking.html
    http://www.w3schools.com/HTML/html_links.asp
    Thanks,
    Maggie

  • Link to another page in a new browser window

    Hey Guys,
    I wanted to know how to set up a link to another page that loads up in a new browser window.
    This what my code looks like:
    <!--
    htp.print('<center>' || :P1_11 );
    htp.print('
    --!>
    This works but the problem is that it goes straight to the login window and asks the user to login again and then it goes to the desired page. Is there a way to set up the link so it goes directly to the new page in a new browser without having the user to log in again?

    Have you tried using the #SESSION# substitution string in the URL instead of hard-coding the session ID into the link?
    By the way, why is so much of your stuff in anonymous blocks/procedures? Just curious.
    Earl

  • Dynamic Select List - XML and umlaut

    Hi, I've recently implement a dynamic select list as per [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=327306], however it seems to break if I have any words containing an umlaut. I've tried setting the header on the Application Process to UTF-8 (OWA_UTIL.mime_header ('text/xml', FALSE, 'utf-8');) but it doesn't seem to make any difference. The word in particular giving me problems is Kühne - it's the only non english entry so far, but I would expect others in the future.
    Does anyone have any ideas how to allow this character to be parsed correctly? Short of using replace to check for this and every other possible character I'm not sure what else to do.
    Thanks

    Pete88 wrote:
    Hello
    I would like to create a dynamic select list where you can start entering a name and select list reduces with each character entered.
    E.g. A list of towns in the UK where you want to select London. This list is delay as normal and as start typing by the time you have entered “Lon” the list only has few names starting with “Lon”
    I expect I need a JavaScript to active this?Not in APEX 4.x. Use a Text Field with autocomplete item.

  • Dynamic Select List in Reports

    Hi,
    I have come across solutions to implement dynamic Select Lists. But can the same be implemented in a report.
    I have a report of 2 columns which are select lists. The Value of one depends of the other.
    Can this be done?
    Thanks in Advance

    Hi Abdullah,
    Thanks for the Tip. However, couple of queries.
    1) The first modification involves changing the query to : select lov_pkg.savekey() , colA, colB, ... But the function savekey takes a value.
    Ideally, I need this function to be called while loading and when the first select list is changed. How can this be done.
    2) Also, To make this change in query, I had to use (Use Generic Column Names (parse query at runtime only)) option. Now my Add Row button doesnt work? Can you tell me how that can be customized.
    Thanks,
    Sunil

  • Dynamic select list with display,return val & join condition issue.

    hello,
    I am having a dynamic select list with display, return value
    say for example my select statement is
    select distinct dname d, deptno r
    from dept dt
    right join emp e on (e.deptno=dt.deptno)
    where (condition)
    when i tried this query for my select list, it is not working. It saying that
    " LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query. "
    I am not able to understand the problem. Can anyone help me out with this issue?
    thanks.

    Shouldn't your join have dept as the driving table?
    select distinct dname d, deptno r
    from dept dt
    right join emp e on (dt.deptno = e.deptno)
    where (condition)
    Or using older Oracle standard join
    select distinct dname d, deptno r
    from dept dt, emp e
    where (dt.deptno (+) = e.deptno) AND (OTHER WHERE condition)
    OR
    (Since a right join is just getting the values from the driving table that are NOT in the associated table)
    select distinct dname d, deptno r
    from dept dt
    WHERE dt deptno NOT IN (SELECT deptno FROM emp) AND (OTHER where condition)
    Thank you,
    Tony Miller
    Webster, TX

  • Cannot make a dynamic  select list

    I couldn't make a dynamic select list in a jsp. please help

    <select name='item'>
                   <option value='-1'>Select Option</option>
    <%
                   rs=stmt.executeQuery("select * from item_master");
                   while (rs.next())
    %>
                             <option value='<%= rs.getString("item_code") %>'
    <%
                             if (rs.getString("item_code").equals(stritemcode))
                                  out.println(" selected ");
    %>
                             ><%= rs.getString("item_description") %></option>
    <%
    %>
                   </select>
    Hope the code snippet helps you. Here stritemcode is the value that should be selected. Amol

  • How to link to another page in same application?

    I think I have a brain fog right now. Cause I can't figure this out.
    I would like to link to another page in the same application by way of just an arbitrary word in a paragraph.
    I am not trying to pass any values. I am not using a button or a text item.
    How can I make a link out of a word?
    Thanks much,
    Maggie

    Hi Maggie!
    I imagine myself, that you have a html text and you want to have a hyperlink to another page in your application.
    For instance you have a text like: "I want to create a hyperlink to a page"
    Now, if your mouse passes the word "hyperlink", you want to see that magic 'hand'.
    First copy the URL of the target page: something like this -> "http://127.0.0.1:8080/apex/f?p=100:2:3122716493255005::NO:::"
    Than change your html text in this way:
    I want to create a hyperlink to a page
    I hope, it helps
    Gerhard

Maybe you are looking for

  • Moving a site in early development from CSS/HTM to PHP

    Hello.  I am early in the development of my latest site, which I began constructing using CSS and HTML.  My pages were .htm's.  After studying up on .php, I decided that i wanted this site to be in .php, so that I could do some things server side, li

  • Using variable as table name in pl/sql query - Is possible?

    I am relatively new to PL/SQL and I am trying to create a function that accepts a table name and a rowid as arguments and returns a comma-delimited record string of the values of the table/rowid being passed. The problem is , I cannot code a select s

  • Can shift operator overflow?

    say i have int a=99; int b=1; what's going to happen if I do a=b<<99;

  • Error in Inventory Service...

    I have an error on my ZenWorks Inventory service but I am unsure what I need to do about it. The error is: Trying to connect to Master XML Server The Novell knowledgebase tells me that I need to run ZWF.NCF before the StartInv.NCF, but I cannot seem

  • When I open iphoto, I only get the spinning color wheel

    When I open iphoto, the window is blank and I just get the spinning color wheel.  I have OSX 10.6.8.  The last time I used iphoto I had deleted over 100GB of photos (they were backed up to an external hard drive). Now I just get the spinning wheel.