JavaScript Radiogroup/Select List

Hi,
I would to multiple the values of a radiogroup and a select list.
This is what I have so far:
<script type="text/javascript">
  function sumItems(){
    function getVal(item){
   if(document.getElementById(item).value != "")
     return parseFloat(document.getElementById(item).value);
   else
     return 0;
    document.getElementById('P1_TOTAL').value =
       getVal('P1_RADIO') * getVal('P1_SELECT');
</script>
I get a NaN error; I assume that is because of the radiogroup and/or select list.
Is this a correct assumption?
Thanks
VC

Hello,
The following is a very simple example of the technique I offered you - http://apex.oracle.com/pls/apexbeta/f?p=10:30 . You can adapt it to any specific select lists you are using, and to any number of them.
I defined 3 hidden items on the page:
- P30_ORIGINAL – holds the original value of the select list
- P30_FLAG0 – set to ‘true’ if a select list value set to 0. Init value 'false'
- P30_FLAG2 – set to ‘true’ if a select list value set to 2. Init value 'false'
The following is the JavaScript code:
<script type="text/javascript">
function saveOriginalValue(pItem){
  $x('P30_ORIGINAL').value = pItem.value;
function validate_Selected_Value(pItem){
  if ($x('P30_ORIGINAL').value == 0 && pItem.value != 0) {
    $x('P30_FLAG0').value = 'false';
  if ($x('P30_ORIGINAL').value == 2 && pItem.value != 2) {
    $x('P30_FLAG2').value = 'false';
  if (pItem.value == 0) {
    if ($x('P30_FLAG0').value == 'true'){
      alert("You can't choose 0 as a value");
      pItem.value = '%';
      return;
    $x('P30_FLAG0').value = 'true';
  if (pItem.value == 2) {
    if ($x('P30_FLAG2').value == 'true'){
      alert("You can't choose 2 as a value");
      pItem.value = '%';
      return;
    $x('P30_FLAG2').value = 'true';
</script>For each select list item I’m using the following events (in the ‘HTML Form Element Attributes’ field):
onfocus="saveOriginalValue(this)" onchange="validate_Selected_Value(this);"As you can see, this code is generic, so you can use it with as many select lists you need on your page.
Regards,
Arie.

Similar Messages

  • How to populate 'Select List' based on Radiogroup selection?

    Hi,
    I've a Radiogroup and on the selection of any of its item, I've to populate a 'Select List' from DB, what is the best way to do this?
    I'm on APEX 2.1.0.00.39, and the Radiogroup & Select List are part of a Form Region.
    To be honest, I don't even know whether to use Radiogroup with submit or redirect :-)
    Thanks for the help,
    -Hozy

    Hi,
    I have never worked on ver 2 of APEX so i dont know wheter these functionality will work or not..
    Option 1)
    1) Make the Radiogroup as Radiogroup(with submit)
    2) Create a select list with query something similar to
    select display_value d , return_value r from myTable where someColumn = :P1_MY_RADIO_BUTTON;
    Option 2) Use AJAX.. htmldb_Get()
    Regards,
    Shijesh

  • Select list in radiogroup options

    Is there any way to achieve the following layout
    o Radiogroup Option 1 [Select List] o Radiogroup Option 2Yes, I can easily do
    o Radiogroup Option 1 [Select List]
    o Radiogroup Option 2which is close enough, but just wondering if the other one was possible.
    Thanks

    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

  • Select list display value in javascript function

    Hi All,
    I have a select list in a tabular form having a display value & return value.
    I am using $x(var_name).value or $v(var_name) for retreving return value of the select list in a javascript function.
    Can anyone let me know how can I get the display value of the select list in a javascript function? Im using Apex 3.2
    Thanks & Regards,
    Sandeep

    What if the select list is not an item. Select list I am talking about is in a tabular form.Regardless of how they're generated in APEX, in JavaScript they're all DOM nodes. There are many ways of accessing the node of the required element. Consider the Items for Order... tabular form on page 29 of the Sample Application:
    var productNameLOV = document.wwv_flow.f04[0] // select list containing name of product on first order line
    var productNameLOV = $x("f04_0001") // another way of accessing the same node, using the ID attribute generated by apex_itemWe can see this using the Safari console:
    => productNameLOV = document.wwv_flow.f04[0]
        <select name="f04" id="f04_0001" autocomplete="off">…</select>
    => productNameLOV = $x("f04_0001")
        <select name="f04" id="f04_0001" autocomplete="off">…</select>Once you've got the node&mdash;however you get it&mdash;you then use the methods shown above:
    => i = productNameLOV.selectedIndex
        3
    => productNameLOV.options.text
    "Business Shirt [$50]"
    So it appears you would use:var item = document.wwv_flow.f01[i];
    var selected = item.selectedIndex;
    var selectedOption = item.options[selected].text;
    This is meaningless:...
    var my_var = document.wwv_flow.f01[i].id; // f01 is tabular column of select list
    if ($x(my_var) == 'display_value') //$x(my_var) is having return value, but i need display_value there
    <tt>$x(my_var)</tt> returns a DOM node object, whilst <tt>'display_value'</tt> is a string: they are not comparable.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to get Saved Selection list in javascript?

    Hello!
    Recently I met a little problem about save selection. I want to get saved selection list so that I can used in javascript. Now I have no ideals. Hope you tell me some useful information about how to get Saved Selection list in javascript!

    Mark is right, it's not possible.
    But do you know you can assign selection to a variable, and get back to it simply like this?
    var sel = app.selection;
    app.selection = null;
    /* your codes here
    app.selection = sel;

  • Javascript error in IE after re-generating select list

    Hi,
    I have 2 select lists (Apex 4 cascading select list; the second one is driven by the first one) in a form. I use jQuery modal dialog to show a hidden item to allow users to add new values to the second select list. After that, I use the following JavaScripts to re-generate the options in the second select list. Somehow, in IE, it re-generates the options but shows error after that. It looks like the error complains somewhere after the options have been re-generated.
    Does anyone have any idea about how to force a select list to refresh (or any jQuery/Apex API) - without submitting the form?
    Thanks.
    Andy
    <pre>
    function addDesc()
    var ajaxRequest = new htmldb_Get(null, &APP_ID., 'APPLICATION_PROCESS=ADD_EXP_CATEGORY_SUB', 0);
    ajaxRequest.add('P5_MODALFORM_CAT_SUB', $v('P5_MODALFORM_CAT_SUB'));
    ajaxRequest.add('P5_INV_EXP_CATEGORY_PK', $v('P5_INV_EXP_CATEGORY_PK'));
    var gReturn = ajaxRequest.get();
    if (gReturn) {
    if (gReturn > 0) {
    closeForm();
    // reload description select list
    reload_exp_cat_sub('P5_INV_EXP_CATEGORY_SUB_PK',gReturn);
    } else {
    alert('Error inserting category sub');
    } else {
    alert('Error inserting category sub');
    ajaxRequest = null;
    function reload_exp_cat_sub(pSelect,pReturn){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    var get = new htmldb_Get(null,&APP_ID.,
    'APPLICATION_PROCESS=RELOAD_EXP_CAT_SUB',0);
    gReturn = get.get('XML');
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    // Select the new value just inserted
    html_SetSelectValue(l_Select,pReturn);
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </pre>

    Hello Ellie,
    I see the same behavior and I'm looking into it. Thanks for
    your patience.
    Best regards,
    Corey

  • Creating dependent select list menus with javascript

    Hi Everybody,
    I m creating parent and child select list menu. Value of Child menu would be dependent on the value selected in the parent menu. I have tried to implement a code from adobe labs  (http://kb2.adobe.com/cps/149/tn_14924.html) but many strange javascript errors are coming up.
    My code is given below:
    <?php require_once('../Connections/connection.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    mysql_select_db($database_connection, $connection);
    $query_sector = "SELECT * FROM sector WHERE media_code = 100 ORDER BY sector_desc ASC";
    $sector = mysql_query($query_sector, $connection) or die(mysql_error());
    $row_sector = mysql_fetch_assoc($sector);
    $totalRows_sector = mysql_num_rows($sector);
    mysql_select_db($database_connection, $connection);
    $query_rsList2 = "SELECT subsector_code, subsector_desc, sector_code FROM sub_sector ORDER BY sector_code ASC";
    $rsList2 = mysql_query($query_rsList2, $connection) or die(mysql_error());
    $row_rsList2 = mysql_fetch_assoc($rsList2);
    $totalRows_rsList2 = mysql_num_rows($rsList2);
    ?>
    <!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=utf-8" />
    <title>Untitled Document</title>
    <!-- Dynamic Dependent List box Code for *** JavaScript *** Server Model //-->
    <script >
    <!--
    var arrDynaList = new Array();
    var arrDL1 = new Array();
    arrDL1[1] = "selList1";              
    // Name of parent list box
    arrDL1[2] = "form1";                 
    // Name of form containing parent list box
    arrDL1[3] = "selList2";              
    // Name of child list box
    arrDL1[4] = "form2";                 
    // Name of form containing child list box
    arrDL1[5] = arrDynaList;
    <%
    var txtDynaListRelation, txtDynaListLabel, txtDynaListValue, oDynaListRS; txtDynaListRelation = "sector_code";
    // Name of recordset field relating to parent
    txtDynaListLabel = "subsector_desc";
    // Name of recordset field for child Item Label
    txtDynaListValue = "subsector_code";
    // Name of recordset field for child Value
    oDynaListRS = rsList2;
    // Name of child list box recordset
    var varDynaList = -1;
    var varMaxWidth = "1";
    var varCheckGroup = oDynaListRS.Fields.Item(txtDynaListRelation).Value; 
    var varCheckLength = 0;
    var varMaxLength = 0;
    while (!oDynaListRS.EOF){
    if (varCheckGroup != oDynaListRS.Fields.Item(txtDynaListRelation).Value) {
        varMaxLength = Math.max(varCheckLength, varMaxLength) varCheckLength = 0; }
        %>
        arrDynaList[<%=(varDynaList+1)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListRelation).Value)%>";
        arrDynaList[<%=(varDynaList+2)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListLabel).Value)%>";
        arrDynaList[<%=(varDynaList+3)%>] = "<%=(oDynaListRS.Fields.Item(txtDynaListValue).Value)%>";
        <%
        if (oDynaListRS.Fields.Item(txtDynaListLabel).Value.length > varMaxWidth.length) { 
        varMaxWidth = oDynaListRS.Fields.Item(txtDynaListLabel).Value; }
        varCheckLength = varCheckLength + 1; varDynaList = varDynaList + 3;
        oDynaListRS.MoveNext(); }
        varMaxLength = Math.max(varCheckLength, varMaxLength);
        %>
    //--></script>
    <!-- End of object/array definitions, beginning of generic functions -->
    <script >
    <!--
    function setDynaList(arrDL){
    var oList1 = document.forms[arrDL[2]].elements[arrDL[1]];
    var oList2 = document.forms[arrDL[4]].elements[arrDL[3]];
    var arrList = arrDL[5];
    clearDynaList(oList2);
    if (oList1.selectedIndex == -1){
    oList1.selectedIndex = 0; }
    populateDynaList(oList2, oList1[oList1.selectedIndex].value, arrList);
    return true; }
    function clearDynaList(oList){
    for (var i = oList.options.length; i >= 0; i--){
    oList.options[i] = null; }
    oList.selectedIndex = -1; }
    function populateDynaList(oList, nIndex, aArray){
    for (var i = 0; i < aArray.length; i= i + 3){
    if (aArray[i] == nIndex){
    oList.options[oList.options.length] = new Option(aArray[i + 1], aArray[i + 2]);
    if (oList.options.length == 0){
    oList.options[oList.options.length] = new Option("[none available]",0); }
    oList.selectedIndex = 0; }
    function MM_callJS(jsStr) { //v2.0
      return eval(jsStr)
    //-->
    </script>
    </head>
    <body onload="MM_callJS('setDynaList(arrDL1)')">
    <form action="#" method="get" name="form1">
    <select name="selList1" onchange="MM_callJS('setDynaList(arrDL1)')">
      <?php
    do { 
    ?>
      <option value="<?php echo $row_sector['sector_code']?>"><?php echo $row_sector['sector_desc']?></option>
      <?php
    } while ($row_sector = mysql_fetch_assoc($sector));
      $rows = mysql_num_rows($sector);
      if($rows > 0) {
          mysql_data_seek($sector, 0);
          $row_sector = mysql_fetch_assoc($sector);
    ?>
    </select>
    </form>
    <form action="#" method="get" name="form2">
    <select name="selList2"></select>
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($sector);
    mysql_free_result($rsList2);
    ?>
    The javascripts errors that I m getting are :
    Syntax error  test.php, line 20 character 1
      'arrDL1' is undefined  test.php, line 74 character 3
      'arrDL1' is undefined  eval code, line 1 character 1
    Note: I have bolded the lines where error is coming up.
    If more info is needed please tell.
    Please Help,
    Thanks in Advance

    You'd probably have to put a copy of the app on apex.oracle.com for a complete diagnosis, but you could maybe just check that the Source Used attribute for teh select list is set to 'Only when current value in session state is null' and not the 'Always' option.
    Regards,
    John.

  • Reducing Select list options with keyboard actions - JavaScript help

    ApExperts,
    My users want a select list with similar functionality to one in MS Access. They want to put the focus on it, then start typing and have their keystrokes 'search' the options. For example, if the select list contains the following entries:
    11111
    12345
    22222
    33333
    44444
    55555
    and they type 1 then 2 then 3, they want the element 12345 to be selected, however, an HTML select list widget selects 11111 then 22222 and finally 33333.
    I'm hoping JavaScript might be able to do this but I don't know how to code it. I've searched this forum and other web sites but have found nothing useful.
    So, is it at all possible and, if so, can you give me an idea of what triggering event to code for and what code to use?
    Thanks,
    X

    BTW, that thread continued - with more options - here:
    AJAX, Javascript or just good coding? LOV that filters as you type??
    If the select list is fixed, you don't need to pull results back from the server as the user types. Then you could try something like this:
    http://www.oreillynet.com/pub/a/javascript/2003/09/03/dannygoodman.html
    Doug
    Message was edited by:
    dccase

  • How to write a javascript function on a report column with type select list

    I have a report with a select list column:
    HTMLDB_ITEM.SELECT_LIST_FROM_LOV(22, "tablename"."PRIMARY", 'PRIMARY').
    The value of primary can be null, yes, no. I want to write a javascript to achieve this: once the user changes one primary value to be yes, others with 'yes' will be changed to 'no' automatically.
    Could somebody help me on this.
    Thanks.
    Jen

    Thanks Patrick for your quick reply.
    I created a dynamic action with the following steps, but the dynamic action is not taking place.
    Event: After Refresh
    Selection Type: Region
    Region: Report 1 (my report name)
    Then in the true action
    Action: Execute Javascript SCode
    Code: showHighlight();
    I even tried to get an alert, but the dynamic action is not done at all. It seems the After refresh dynamic action is not working for a region.

  • Changing a select list using javascript

    Hi all,
    yesterday I had a doubt using apex_item.checkbox and how to change them using javascript:
    Re: Passing a checkbox as a parameter to a javascript function
    Today, I'm facing a similar problem, but with select lists. Here it goes. I have a report with apex_items, like this:
    select
    apex_item.checkbox(1,"ID",NULL,NULL,NULL,'f01_#ROWNUM#') " ",
    apex_item.select_list_from_lov(2,"SW_STATUS",'F2010051_SET_STATUS','onChange="setItems(''f01_#ROWNUM#'',''f03_#ROWNUM@'')"','NO') sTATUS,
    apex_item.select_list_from_lov(3,"REVISIO",'F2010051_SET_REVISIO',NULL,'NO','f04_#ROWNUM#') "REVISIO"
    from Fx1_vThe javascript code is as follows:
    <script type="text/javascript">
    function setItems(cb,estat){
      elem = $x(cb);
      alert(elem.value);
      $x(cb).checked = true;
      elem2 = $x(estat);
      alert(elem2.value); 
    </script>The idea is that everytime the item g_f02 (a select list) changes, calls the JS function with two parameters: a checkbox (g_f01) and another select list (g_f03). The function should change the items to a defined values. The checkbox changes ok thanks to the help I got yesterday, but I can't work with the third item (select list g_f03). When I try to show the value, it says "undefined".
    how could I see the actual value of the select list LOV and change it to 1, for example?
    Thank you very much, any help will be appreciated!!!
    Edited by: Elena.mtc on 19-may-2011 8:11

    Hi,
    Do you have typo in query?
    Should it be
    select
    apex_item.checkbox(1,"ID",NULL,NULL,NULL,'f01_#ROWNUM#') " ",
    apex_item.select_list_from_lov(2,"SW_STATUS",'F2010051_SET_STATUS','onChange="setItems(''f01_#ROWNUM#'',''f03_#ROWNUM#'')"','NO') sTATUS,
    apex_item.select_list_from_lov(3,"REVISIO",'F2010051_SET_REVISIO',NULL,'NO','f04_#ROWNUM#') "REVISIO"
    from Fx1_vAnd JavaScript
    <script type="text/javascript">
    function setItems(cb,estat){
      elem = $x(cb);
      alert(elem.value);
      $x(cb).checked = true;
      elem2 = $x(estat);
      alert(elem2.value); 
      $s(elem2,1); // $s function is for changing item value
    </script>Regards,
    Jari

  • Need a little JavaScript help with disabling a select list in a tabular frm

    Hello Folks
    Here's the scenario.
    I have a tabular form which, subject to the setting of one Select List, I want to disable/enable another.
    I have got this far and it will disable a text item but not a select list..
    This is in the HTML header section for the page...
    <script type="text/javascript">
    function test(pThis)
    var currIndex = $('select[name="'+pThis.name+'"]').index(pThis);
    if (pThis.value=='2') {
    $('input[name="f02"]')[currIndex].style.backgroundColor = "LightGrey";
    $('input[name="f02"]')[currIndex].disabled=true;
    The report region is defined as...
    SELECT apex_item.text(1, ir.iot_rebate_type_id) iot_rebate_type_id
    ,apex_item.select_list_from_lov_xl(2,ir.rebate_currency,'LOV_CURRENCY_CODES') rebate_currency
    FROM iot_rebate ir
    WHERE ir.iot_agreement_id = :P303_IOT_AGREEMENT_ID
    The iot_rebate_type_id column has an Column Element Attribute set to...
    onchange="javascript:test(this);"
    As I say, if I define the rebate currency as a text item, the javascript works fine.
    Can anyone offer any suggestions?
    Many thanks
    Simon
    Application Express 4.0.2.00.07

    Simon Gadd wrote:
    Hi Vikram.
    That's great.
    I have the relevant items being set to diabled & grey (and also the reverse of this if the driving select list is changed back).
    As this is being used in a Tabular form, if I am calling pre-existing records which should be displayed with two of the select lists disabled, can you point me in the right direction to show the relevent select lists as disabled when the records are returned from the database?If you are using apex_item API set the disabled property into p_attributes parameter conditionally using a case statement in you sql statement
    Another option is you can use some javascript to loop through the tabular form array that runs on the onload of the page.
    Finally, if some columns are disabled, this invaludates the MRU process on the page. Is there a way to submit the page with some fields in the disabled state?Do that as per Roel's suggestion for this issue.
    Any input/pointers much appreciated.
    Simon

  • Javascript / Select List with Submit problems

    I have a page (page 3) where I can either edit or create a record. If I am editing a record, the data loads on page 3 via a PL/SQL block. On page 3, I have a textual item with Javascript linked to it which pops up a new window. In the Javascript, I am passing three values to the next page. Two of those values (P3_ITEM1, P3_ITEM2) are 'Select List with Submit'. If I am creating a new record from page 3, the Javascript works fine and the popup window comes up when I click on the textual item. However, if I am editing an existing record, I get an error when I click on my textual link. Looking at the address bar, it is not passing the value of P3_ITEM1 and P3_ITEM2 to the next page. It does, however, pass the value of P3_ITEM3 (not a 'Select List with Submit') to the next page. Again, the Javascript popup works fine if I use the 'Select List with Submit' fields to populate P3_ITEM1 and P3_ITEM2 (i.e. if I submit those fields) and it does not work if P3_ITEM1 and P3_ITEM2 are already populated when page 3 loads (i.e. if I do not submit those fields). Looking at the session variables, it appears as though P3_ITEM1 and P3_ITEM2 are set prior to clicking the link which initiates the Javascript. However, the URL in the popup window says the value of those fields is 'undefined'. Does anybody have any idea what I can do to make this work or why it is not working? Thanks.
    -Chris

    Hello Chris,
    It seems like you are having some problem with setting/reading session state, but it’s really hard to pin point the problem without seeing any code. Can you post your two pages on apex.oracle.com?
    Regards,
    Arie.

  • Javascript alert from a select list

    I have a select list that will show on one of the options "sold out" if this is chosen and submitted i want a alert so say " sorry sold out"
    can this be done and if so how
    thanks for any advise

    Such a script would best be installed on the target page for that particular item on the select list.
    May I suggest a more elegant notification such as one on Nancy's site.
    http://alt-web.com/DEMOS/CSS-Sold-Out-Text-over-image.shtml
    If you are satisfied with just an alert, see here:
    http://www.w3schools.com/jsref/event_body_onload.asp

  • How do you clear a select list in javascript?

    Hi,
    I've tried clearing a select list (after it has been populated) by
    html_GetElement('P_CAMPUS').value='';
    html_GetElement('P_CAMPUS').value=null;
    these clear the visible field but if you click it all the options are still there.
    I tried:
    html_GetElement('P_CAMPUS')=null'';
    It is probably a real easy thing... but I don't see it...\
    Thanks, BillC

    To delete all the options in the select/dropdown list, you go
    html_GetElement('P91_SELECT').options.length=0;

  • 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

Maybe you are looking for

  • How to change 2 ipods and one account

    When I plugged in my new ipod touch, I thought that it would ask me to create a new itunes account but instead it just copied everything from our other account.  So now we have two ipods with the same name and account.  How can I erase what's on the

  • HP OfficeJet Pro 8600 Plus will print wirelessly but not scan

    I have a HP OfficeJet Pro 8600 Plus all in one printer/copier/scanner. It's worked fine for the several months I have had it. But now suddently the computer does not recognize the scanner. I am connected to the device wirelessly and can print but not

  • DVD to ipod conversion

    I've read several of the forums on how to convert DVDs to work on the ipod. I've downloaded a decypher Application which worked fine however when using the converter it takes forever to convert the file to store it into itunes. I'm converting the mov

  • ITunes won't sync music to my iphone.

         A little context. I've always shared an itunes account with my cousin and all our songs would be the same. But to make this possible i would have to meet him and sync my iphone on his computer. But i have my own computer now with alot of differe

  • Symbol in equations disappears.

    Hello! I have posted this in the Microsoft Community originally, and was referred to this support forum. My problem is as follows. I am using Word 2010 and have a lot of equations is my document. Some of these equation fields just contain "k=A,B" (so