Getting the corresponding selected value in the textbox

hi..
i had a problem ,i had a jsp page ,with a selectbox and a textbox,the select box is getting the list of formnames from the database,and each form name has a corresponding code in the same table named form
here thru mi program i m getting but i am connecting to the dtabase twice,is there any way to get the same...here is my code...
<%@ page language="java" import="java.sql.*,java.util.*"%>
<%
Connection con=null;
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:satya");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select form_code,form_name from form");
//System.out.println("Hashtable"+h.toString());
%>
<script language="JavaScript">
function url()
document.myform.action="http://localhost:8080/dynamic/servlet/Servlet1";
document.myform.submit();
function fn(code1){
var code;
var code2=code1.value+"code";
//alert(code2);
var str="document.myform."+code2+".value";
code=eval(str);
document.myform.forcode.value=code;
</script>
<form name="myform" method="post">
<select name="selform" onChange="fn(this)">
<% while(rs.next()){
String name=rs.getString(2);
String code=rs.getString(1);
%>
<option value="<%=name%>"><%=name%></option>
<%}%>
</select>
<% rs.close();
rs=st.executeQuery("select form_code,form_name from form");
while(rs.next()){
String name=rs.getString(2);
String code=rs.getString(1);
%>
<input type="hidden" name="<%=name%>code" value="<%=code%>">
<%}%>
<input type="text" name="forcode">
<%
rs.close();
catch(Exception e){
System.out.println(e);
%>
<br><br>
<input type="submit" name="Submit" value="create" onClick="url()">
</form>
</body>
</html>
can any one help me...........
Thanks in advance

I think you are submiting the Form Twice
The first time when you Click the Submit Button, the second time in the url function
you have to remove the OnClikc event from this Line
<input type="submit" name="Submit" value="create" onClick="url()">

Similar Messages

  • Getting the last selected value of the combo  - very very urgent...........

    On my panel i have a jcombobox in upper half(which displays say the address type.) and few text fields on the lower half(which displays the add details). when the user selects a value in the combo box the text fields are populated based on the selection. The user can change the values displayed in the text fields. So before setting the new values in the text fields the last displayed values need to be saved.
    I have an ActionListener for my combo which gives me the currently selected value by calling getSelecetdItem()
    How can i get the last selcted value of the combobox without using any variable of my own.

    To update the last displayed details(the address details say) i need to check what type of address the combo had previousely.....
    when i display the panel first time the home address is set by default and i have a variable to hold this value..as the user changes the selection i update the variable...I don't want to use this variable..instead if i can get the last selcted value from the event that would be great...
    thanks

  • How to get the previoulsy selected value in a combobox

    How to get the previoulsy selected value in a combobox. i WANT the current and the previously selected value of the combobox.

    Just add to combobox ItemListener. When item is changing in itemStateChanged arrives 2 events. ItemEvent.DESELECTED and ItemEvent.SELECTED with corresponding item's values. Just write something like this:
            comboBox.addItemListener(new ItemListener() {
                Object prevValue;
                public void itemStateChanged(ItemEvent e) {
                    if (e.getStateChange() == ItemEvent.SELECTED) {
                        //do what you need with prevValue here
                    } else {
                        prevValue = e.getItem();
            });

  • How to directly get the selected value in the dropdown

    Hi Experts
        Now, in POV, i want to directly get the selected value in the dropdown. Because, the program doesn't enter the PAI before POV part. Therefore, the corresponding variable of dropdown doesn't store the selected value. That's reason why i want to find a way to directly get the selected value in the dropdown. is there any function module to do this?

    you can use INITIALIZATION event which triggers first before any other events..
    and u can use VRM_SET_VALUES to populate the values in the list
    DATA : v TYPE vrm_values.
    DATA : vw LIKE LINE OF v.
    INITIALIZATION.
      vw-key = '1'.
      vw-text = 'ABC'.
      APPEND vw TO v.
      vw-key = '2'.
      vw-text = 'DEF'.
      APPEND vw TO v.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = 'A'
          values          = v.
    PARAMETERS : a TYPE c VISIBLE LENGTH 10 AS LISTBOX.

  • Need to get the selected values from the selectManyShuttle

    Hi,
    I am using ADF11g newer version.
    I have a selectManyShuttle and a command button. Need to insert all the selected values on the right hand side of the selectManyShuttle into a database table.
    I created the selectManyShuttle with the values. Need help in getting the values on the right hand side.
    <af:selectManyShuttle value="#{bindings.UserMgmtVO1.inputValue}"
    id="sms2">
    <f:selectItems value="#{bindings.UserMgmtVO1.items}"
    id="si6"/>
    </af:selectManyShuttle>
    Any sample code or link is really appreicated.
    Thanks

    Thanks for the reply.
    I am using a View Object and I dropped it as SelectManyShuttle
    <af:selectManyShuttle value="#{bindings.UserMgmtVO1.inputValue}"
    id="sms2"
    valueChangeListener="#{POBacking.getSelectedValues}"
    valuePassThru="true"
    autoSubmit="true">
    <f:selectItems value="#{bindings.UserMgmtVO1.items}"
    id="si6"/>
    </af:selectManyShuttle>
    public void getSelectedValues(ValueChangeEvent valueChangeEvent) {
    System.out.println("Testing Shuttle");
    ArrayList list = new ArrayList(Arrays.asList(valueChangeEvent.getNewValue()));
    String val = "";
    String sqlStmt = "";
    try {
    if (list != null) {
    for (int i = 0; i < list.size(); i++) {
    int l = list.size() - 1;
    val = list.get(l).toString(); //returns , delimited string
    System.out.println(" value:" + val);
    if (val != null) {
    val = val.replaceAll("[\\[\\]]", ""); //remove []
    StringTokenizer st = new StringTokenizer(val, ",");
    int nto = st.countTokens();
    for (int j = 0; j < nto; j++) {
    String users = st.nextToken().trim();
    System.out.println("Users:" + users);
    //sqlStmt = " update xxpp_project_clip set clip_status='true', clip_seq = "+j * 10+
    // " where project_id = "+rHdr.getAttribute("ProjectId") +
    // " and clip_name ='"+ clip_Name +"'";
    //System.out.println("sqlStmt:" + sqlStmt);
    //stmt.executeUpdate(sqlStmt);
    //am.getDBTransaction().commit();
    //if (stmt != null)
    // stmt.close();
    // am.getDBTransaction().commit();
    } catch (Exception ex) {
    ex.printStackTrace();
    I don't see the values in the list.
    I gets printed as
    value:[Ljava.lang.Integer;@1b10691
    Users:Ljava.lang.Integer;@1b10691
    how to get the individual values in the list?
    Thanks
    Saru

  • How to get the current selected value of a combo box or a option button?

    Hello All,
    I want to catch the current selected value of a combo box and also of a option button and want save it into different variables in my code. These option button and combo box are in a SAP business one form which I have created through VB dot.net coding.
    But I don't know how to do that, can any one send any example code for this.
    Regards,
    Sudeshna.

    Hi Sudesha,
    If you want to get the selected values you can do it as follows: The Combo Box value you can get from the combo box. If you want to get it on the change event, you must make sure that you check when BeforeAction = False. If you want to get an Option Button value you should check the value in the data source attached to the option button.
            Dim oForm As SAPbouiCOM.Form
            Dim oCombo As SAPbouiCOM.ComboBox
            Dim oData As SAPbouiCOM.UserDataSource
            oForm = oApplication.Forms.Item("MyForm")
            oCombo = oForm.Items.Item("myComboUID")
            oApplication.MessageBox(oCombo.Selected.Value)
            oData = oForm.DataSources.UserDataSources.Item("MyDataSourceName")
            oApplication.MessageBox(oData.ValueEx)
    Hope it helps,
    Adele

  • Copy select value in the textfield from LOV and allow user to edit it

    Hi,
    I have a datablock with 20 records and each record has comments (say field_comments) fields. I would like to allow user to choose predefined comments populated from LOV (say lov_comments) and to append some extra comments after they choose the value from LOV.
    I have created a LOV and added Return type “field_comments” in the column mapping properties. When user clicks on a button, LOV opens up. They select the value from the LOV and the value goes to “field_comment” field. The problem with this approach, user can’t add their comment after selecting from LOV.
    I tried this way too. I created another non-visible textbox (say dummy). In the LOV, I added “dummy” field as returntype. In the dummy field, I have created “POST-CHANGE” trigger which basically says :block. field_comments = :block. Dummy.
    But, the user has to click on other field to view the selected value from the LOV. The values in the “field_comments” is not updated as soon as user click on “OK” button in the LOV.
    I would appreciate it if somebody could give me some input and help to solve my issue. Thank you for your help.
    Thank.

    Well, I tried exactly what you posted and it allowed me to SELECT from LOV and then CHANGE/APPEND new text in front of returned value in the field. It saved to the database and queried without any problems.
    Is your item allowed to INSERT/UPDATE ? If not, then set "Update/Insert Allowed" properties to Yes and attach your LOV to the item and set "Validate from list" to No.
    You may also see if you have any validation being performed on WHEN-VALIDATE-ITEM or POST-CHANGE trigger which will fail since you are editing the values populated from LOV.
    Hope it helps!

  • How to capture the selected values of the filter?

    Hi Everybody
    I have created a dashboard using a 4 column filter. It all works well - no problem.
    I now need to enhance the functionality of the dashboard which needs the selected values of each of the parameters of the filter. As far as I know, the selections of the fiilter columns are not "Inserted In" any cell, only the data values of the corresponding row not including the filter columns are inserted in the "Inserted In" row, is there a way to capture the values of the filter column selections in some cells on the spreadsheet?
    An early response from you all shall be highly valued.
    Also, does anyone know which is the current equivalent version of Xcelsius to the old Xcelsius Workgroup version. This Xcelsius Workgroup version supported the "XML Integration Dynamic Refresh" wherein you didn't have to reinserted the updated Excel spreadsheet into Xcelsius have an updated dashboard - as long as the corresponding XML files were updated with the latest data, the exported dashboard would refresh.
    Best regards
    Deepak Agarwal

    Along with the PBO and PAI event, add a POV event in the flow logic of the screen
    DEMO_DROPDOWN_LIST_BOX -is a good demo example.
    PROCESS ON VALUE-REQUEST.
    FIELD structure_name-field_name MODULE create_dropdown_box.
    In the report :
    MODULE create_dropdown_box INPUT.
      SELECT carrid carrname
                    FROM scarr
                    INTO CORRESPONDING FIELDS OF TABLE itab_carrid.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'CARRID'
                value_org       = 'S'
           TABLES
                value_tab       = itab_carrid
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc <> 0.
      ENDIF.
    ENDMODULE.
    In the layout, assign a Function Code , for eg : 'SELECTED' to the listbox and lets say name of the field is SDYN_CONN-CARRID. So in the PAI module,
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'SELECTED'.
          MESSAGE i888(sabapdocu) WITH sdyn_conn-carrid.
      ENDCASE.
    ENDMODULE.
    sdyb_conn-carrid will contain your selected field

  • 11.1.1.4:Could not find the item selected to match the value of type Number

    Hi,
    I have a taskflow with an input parameter.
    The input parameter value is to be assigned to a list item as the default selected value.
    I have mapped the pageFlow scope parameter to set value to the list item using input page parameters defined in task flow.
    but When i Run the task flow the value does not get assigned to the drop down list and jdevloper console screen shows up the following message
    "Could not find the item selected to match the value 2 by type: oracle.jbo.domain.Number in LOV."
    But If I click the Lov to check the values it shows that value is present in the list.
    The same configurations works if the list of values is for a column with type as java.lang.String.
    Is it somethng different that is to be done for a Number field to assign value from a taskflow parameter?
    Edited by: user3067156 on Jun 25, 2011 3:34 PM

    Hi Jobinesh,
    I am assigning the default value in the task flow using input page parameters ...
    <view id="VIEW1">
    <page>/title.jsff</page>
    <input-page-parameter>
    <from-value>#{pageFlowScope.pInputTyp_Id}</from-value>
    <to-value>#{bindings.pTyp_Id1.attributeValue}</to-value>
    </input-page-parameter>
    </view id>
    It does not assign the value, if Bind variable(pTyp_Id1) NDtype and task flow input parameter(pInputTyp) class type, both are set to use type oracle.jbo.domain.Number.
    If I change both to use java.lang.String and additionally also change the VO defination the accept the bind variable of type string, it assigns the value correctly.
    Usecase:
    I have a a task flow for which has its first page a search page.
    The Search page is created using operation execute with params and dragging the query parameters on the page.
    The Query parameters are to be filled using a select one choice option and the list is bound to the master values.
    This task flow can be used inside a standalone page as a region to provide a search page
    The same task flow can be called from within another taskflow which will provide the default values for the drop down lists ..
    Since the search page is a jsff fragment i dont have a page on load handler to provide default values..
    So assiging the values using input page parameters defined in task flow view tag.
    For testing I am passing the taskflow input parameters by calling the task flow from a jspx page a region . When I configure this task flow a region in a page its asks for providing the values for the parameters
    And the same gets configured in my testpage def as
    <executables>
    <variableIterator id="variables"/>
    <taskFlow id="Flow1" taskFlowId="/WEB-INF/Flow1.xml#Flow1"
    activation="deferred"
    xmlns="http://xmlns.oracle.com/adf/controller/binding">
    <parameters>
    <parameter id="pTyp_Id" value="1207"/>
    </parameters>
    </taskFlow>
    </executables>
    Edited by: user3067156 on Jun 27, 2011 1:50 PM

  • The selected signed file could not be authenticated. The file might have been tampered with or an error might have occured during download. Please verify the MD5 hash value against the Cisco Systems web site

    I am trying to load any 9.0.3 firmware on my UCM 5.0.4.2000-1 server. Every newer firmware I load throws the following error. I have verified the MD5 is correct and also downloaded the file several times with the same result. I can load the same firmware file on another UCM server and it loads fine. Any ideas?
    Thanks in advance!
    Error Message:
    The selected signed file could not be authenticated. The file might have been  tampered with or an error might have occured during download. Please verify the  MD5 hash value against the Cisco Systems web site:  9b:b6:31:09:18:15:e7:c0:97:9f:e6:fe:9a:19:94:99
    Firmware File: cmterm-7970_7971-sccp.9-0-3.cop.sgn
    UCM version: 5.0.4.2000-1

    Thanks for your reply. We have a lab environment where I maintain  UCM 5.0, 5.1, 6.0, 6.1, 7.0, 7.1 and 8.0 servers each running the latest released firmware for our QA testing team. I have downloaded and installed the latest device packages but find that if I try to install any firmware newer then 8.3.1 on either 5.0.4 or 6.0 i start getting MD5 hash authentication errors. It looks like 9.0.3 firmware should work on UCM 5.0 and 6.0 so I am lost as to why I can't seem to update any firmware for any model phone if it is newer then version 8.3.1 on either 5.0 or 6.0. while 5.1 and 6.1 work without issues. Maybe it is just a bug. I mostly wanted to see if anyone else has experienced this or if it is just me.

  • LOV doesn't return selected value to the base page

    Hi All,
    I have created an LOV based on VO. When I select value on the LOV page, it is not returning the selected value to the base page.
    I am getting the error when I select any value .
    Error
    You are trying to access a page that is no longer active.
    - The referring page may have come from a previous session. Please select Home to proceed.
    Can anyone please guide me which property has to be set.
    Thanks,
    Edited by: user4482525 on Apr 21, 2009 11:49 PM

    1> Go to the About this page* of the page and check whether page Root AM is extended or not?
    If the page root AM is extended then delete the extension by jdr_util.deleteDocument or using functional Adminstartor
    or
    2> See in the LOV CO, if you are using the method "releaseApplicationModule"
    If yes , then remove this.
    Thanks,
    Kumar

  • How to select and store the dynamically clicked values in the checkboxes?

    Hi Gurus
    How to select and store the dynamically clicked values in the checkboxes?
    Scenario:-
    I am having a tree structure but I am not getting that user has clicked the which nodes.
    So how to do it.
    Pls.

    Hi,
    Once again, this is dependent on what your implementation expects. It would seem that your implementation is expecting all of the API to be coded in Java Card so it would make sense that you would load these packages like any other package. Loading an applet is not a special case, it just has an extra step of installing instances of it (and can actually be installed). Any other Java package just needs to be loaded. As such, just load your CAP files for each package of the API before loading any code that depends on it.
    Cheers,
    Shane

  • How can we read the screen field values from the report selection screen wi

    Hi expart,
    How can we read the screen field values from the report selection screen with out having an ENTER button pressed  .
    Regards
    Razz

    use this code...
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_posnr.
    **Read the Values of the SCREEN FIELDs
    CALL FUNCTION 'DYNP_VALUES_READ'

  • How to get the User entered value in the Submit request form for a parameter of a concurrent program in Oracle applications.

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

    Hi All,
    I have a requirement where i need to get the user entered value in the Parameter of a concurrent program while submitting it. i tried to query the FND_CONCURRENT_REQUESTS table but in that it stores the ID values from the value set of the Parameter.
    After submitting the Concurrent request when we click on the view Details button it opens a form where it displays the arguments in the parameter field .  i want to get that string.
    Thanks a lot in advance for your time and help.
    - Vijay

  • How to clear the selected values in the JCombobox

    Hi All,
    Can you please tell - how to clear the selected values in the JCombobox
    I have four dropdowns in my application, When I click "CLEAR" button, what ever the values selected in the four drop downs should go off and view as "SELECT" in all the dropdowns.

    In addition to the above you should also check out [Combo Box Prompt|http://www.camick.com/java/blog.html?name=combo-box-prompt] which makes it easy to display the default prompt.

Maybe you are looking for

  • Clean out start up disc I Mac g5

    How can I clean out the start up disk. I do not have enough space to import video into I movie on my G5.

  • How to Install Photo Booth on 10.5.8

    Hai , i need some help here , im totally noob here LOL I accidentally deleted my photo booth , so can somebody tell me how to reinstall +only The Photobooth+ ?? Thanks in advance

  • Create Web Service Ecc 6.0 -Configure Web Aplicat. Serv (SICF, SOAMANAGER)

    Hi Experts, Im trying to consume a Web Service. My client recently upgraded to Ecc 6 version, and want's now to change all teh used RFC's to Web Service, and for all i've red until now this step doesn't seems to be so hard, creating the wsdl from the

  • Unexpected Signal : 10

    My application encounters the following JVM crash on Solaris box. Is there any one knows what happend? An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 10 occurred at PC=0xe6551818 Function name=_XimpLocalO

  • Lost features on Facebook with maverick

    With the upgrade to maverick, I am no longer able to video calling on facebook, I followed the insturctions given to trouble shot by face book I removed video calling from my files and reinstalled. I am still not able do video calling on facebook. Ot