How to return javascript function value to jsp page

Hi i want to retrieve values from javascript function to jsp page, how can i do that ? i am trying this but its not working
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
<td>
<jsp:param id="description" value= "<%=request.initRTE('', '')%>"/>
</td>
here this initRTE function is used for displaying rich text editor .....i want to retrieve back the contetnt written in this editor and save it to DB.
Please help.
Edited by: xtech on Apr 4, 2008 12:00 PM

surely i will do that but my app is still not working.....
here is my code
</td>
<td align="left">
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
<h:inputHidden id="introtext" value= "<%=request.getParameterValues(description)%>">
<script>
initRTE('','');
</script>
</td>
in java script function i am geeting the text content
function initRTE(rtePreloadContent, rteCSS) {
rtePreloadContent=document.getElementById('surveyinfo:introtext').value;
startRTE(rtePreloadContent);
menuBuilder();
var description= document.getElementById(rteFormName).value;
return description;
basically i want to get the text written in text editor in jsp and want to send it to DB.(Here initRTE() function is calling rich text editor)
i have downloaded this editor from this url
http://freerichtexteditor.com/page/4.htm
and trying to embed it in my app.

Similar Messages

  • How to use javascript functions in struts jsp page

    hi
    iam using struts jsp pages. here iam calling one javascript function. but iam not able to access the form in javascript.
    wat i have to give as form name to get the elements of the form.
    please reply me soon
    it is urgent
    vamsi

    your form has no name liek this one:
    <html:form action="/userRegistration.do" >so you cannot access the elements inside your form?
    accessing the elements inside the form will be like this:
    document.forms[0].propertyName.value;

  • How can I access JSP variables from a JavaScript function in a JSP page?

    Respected sir
    How can I access JSP variables from a JavaScript function in a JSP page?
    Thanx

    You may be get some help from the code below.
    <%
        String str="str";
    %>
    <script>
        function accessVar(){
           var varStr='<%=str%>';
           alert(varStr);// here will diplay 'str'
    </script>

  • Can we set h:outputText value= "(some javascript function value)"/

    Hi
    Can we set <h:outputText value= "(some javascript function value)"/>
    In a scenario like when user changes the item in dropdown box. label name as to change for the next text box.
    -----JSP page------
    h:outputText value="*" styleClass="mandatoryField" />
    <h:outputText value="Matching Criteria:" />
    <h:selectOneMenu id="MatchingCriteria" styleClass="dropDownMenu" value="#{OffsetTradingRuleBean.matchingCriteria}"immediate="true" onchange="unitChange()">
    <f:selectItems value="#{OffsetTradingRuleBean.matchingCriteriaMap}"/>
    </h:selectOneMenu>
    <h:outputText value=""></h:outputText>
    <h:outputText value=""></h:outputText>      
    <h:outputText id="DeminimisLabel" value="" ></h:outputText>
    <h:inputText id="DeMinimisUnit" styleClass="text" value="#{OffsetTradingRuleBean.deMinimisUnit}" maxlength="15" onchange="detectChange()" >
    <f:validator validatorId="DefaultValidator"/>          
    </h:inputText>
    <h:outputText value=""></h:outputText>
    -----Java Script-----
    function unitChange(){
         if(document.getElementById("frm:MatchingCriteria").value!="1"){
         alert('inside unitchange--'+document.getElementById("frm:MatchingCriteria").value)
              document.getElementById("frm:DeminimisLabel").value="Deminimis Dollars";
         if(document.getElementById("frm:MatchingCriteria").value!="0"){
              document.getElementById("frm:DeminimisLabel").value="Deminimis Shares";
    thanks in advance
    Rambhapuri

    balu
    actually i want to swap label name using javascript. first i will call onchange event from matching criteria dropdown box . then it will fire unitChange() function.
    then i am putting value Deminimis dollor or deminimis shares accroiding to the value which is there in dropdown.
    this value as to come in <h:outputText id="deminimisLabel" value=" should come value from java script" />
    and it should act dynamically ,. like when ever user changes the dropdown item . the corresponding name should change in lable name.
    thanks
    rambhapuri

  • How to invoke  javascript function after business action??

    How to call javascript function(such as "window.close(), window.open(...),...") in the action method(public String doBusiness(){...}) of <h:commandButton>?If not,then,is there any alternate approach to call javascript function when the bussiness action method finished??
    Thanks a lot!

    Since your business method is called after the form is submitted, and your code is running on the server, probably the only thing you can do is this:
    Create a custom component (Maybe call it the "onLoad" component) that you always render at the top of your JSP. In the regular situation it wouldn't render anything, but in the case you mention, after your busines method, you would call a method on this new component on the server that would cause it to actually render something the next time it is rendered. When rendered this time, it could then render the "onLoad" method which has your window.close() code in it. The window would then close right away.
    The key is that you are not doing any of this on the client. The form is submitted, your business logic is executed, then the next page is rendered. When the next page is rendered, your javascript could be rendered to close the window.
    If I'm offbase here, someone please say something, I'd hate to send this guy on a wild goose chase.
    Dave

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • How to include custom taglib in javascript on a given jsp page

    Hi,
    How to include custom taglib in javascript on a given jsp page?
    i have a jsp page on which i am adding selectboxes using javascript.
    But now i have created my own custom select box and want to add it on a given jsp page.
    is the code to create the box box.
    <sample:pickListOptions employeeId="abcs123"/>
    but how should i embed it in javascript, so that i will be able to add it on the give jsp page.
    Thanks,
    Javaqueue

    when the jsp page is loaded for the first time it contains a select box containg names created by a taglib.but there is a feature i want to add wherein though javascript the name selectebox will keep on coming on each row i want to add. and this is row addition and deletion is being handled by the javascript. there i encounter the bug how to interact the javascript with taglib so tha with each row addition i will have populated taglib created select box on each row.
    Thanks,
    Javaqueue

  • How to call stored function in my jsp

    how to call stored function in my jsp?
    please give me a example.

    Hi,
    think we need mor einformation, like JDeveloper release and the how you do access the database (JDBC, BC4J, EJB,ADF...)
    Frank

  • Call javascript function in an html page, how to?

    How can i call a javascript function in an html page were my flash catalyst swf is?

    I think you will need to import the catalyst fxp into flash or flash builder and add action script to invoke the javascript.
    These two links may be of use
    http://blog.codefidelity.com/?p=15
    http://www.switchonthecode.com/tutorials/flex-javascript-tutorial-simple-interaction
    I hope that helps

  • How to call javascript function?

    Hi,
    How to call javascript function for SAP button
    control onclick event?
    Thanks in advance.

    Hi Sundar,
      u can call java script  in design mode.
      Add this code in ur design part inside body and call the function as
    <sap:button id="a" onSelect="javascript:go();"
    Add inside body:
      <script language="javascript>
    function go(){
    alert("hai");
      </script>
    Regards,
    Vinoth.M

  • How can I pass a value into a page fragment?

    How can I pass a value into a page fragment?
    I am implementing four search screens. And the only thing different about them will be their backing bean.
    So I’d like to do something like have four pages, each which retrieves its appropriate backing bean, sets that bean to a variable, and then includes a page fragment which contains the generic search page code (which will make use of that variable).
    The code in the four pages would be something like this:
    <?xml version='1.0' encoding='windows-1252'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
    xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=windows-1252"/>
    <c:set var="searchPageBackingBean"
    value="#{pageFlowScope.employeeSearchPageBean}"
    scope="page"/>
    <jsp:include page="./SearchPageBody.jsff"/>
    </jsp:root>
    At this point, what I’m seeing is that the fragment page, SearchPageBody.jsff, has no visibility of the searchPageBackingBean variable, either referencing it as #{pageFlowScope.searchPageBackingBean} or just #{searchPageBackingBean}

    The following will work, assuming you are needing to access a managed bean:
    Put this in the parent page:
    <c:set var="nameOfSearchPageBackingBean"
    value="employeeSearchPageBean"
    scope="request"/>
    Put this in the child, SearchPageBody.jsff:
    <c:set var="searchPageBean"
    value="#{pageFlowScope[nameOfSearchPageBackingBean]}"
    scope="page"/>

  • How do i use Connection pool in JSP pages

    Hey everyone,
    I am using a connection pool in my web application. I am using DbConnectionBroker from Javaexchange.com. It has a class that creates a connection pool available for the servlets. I am trying to figure out that how to use connection pool within the JSP pages if I want to connect to the database. In the servlets i am using DBConnectionBroker pool = (DbConnectionBroker) getServletContext().getAttribute("dbPool") to get database connection. How Can i use this in JSP page to get a db connection.
    Thanks

    If the reference to the connection pool is already stored as an ServletContex attribute, try:
    <jsp:useBean id="dbPool" scope="application" class="com.javaexchange.dbConnectionBroker" />
    <%
    Connection con = dbPool.getConnection();
    %>

  • How we can generate dynamic menu in jsp page

    Hi all,
    how we can generate dynamic menu in jsp page.
    Thanks
    Manjinder

    by reading more about them on the web or in a good book, OR BY HIRING SOMEBODY TO DO SO. ;)

  • How to get the value retruned by java script function into my jsp page

    Hai all,
    I had a particular java script function which returns a date.
    function getDate() {
         var sDate;
    // This code executes when the user clicks on a day in the calendar.
    if ("TD" == event.srcElement.tagName)
    // Test whether day is valid.
    if ("" != event.srcElement.innerText)
    //alert(event.srcElement.innerText);
    sDate = document.all.year.value + "-" + document.all.month.value + "-" + event.srcElement.innerText;
    document.all.ret.value = sDate;
    var mahi=window.open("configurexml.jsp?xyz=document.all.ret.value")
    return sDate;}
    Now i want to display this particular date in my jsp page. can anyone tell me the correct approach or a sample code to diaplay this date in my jsp page.
    <%@ page language="java"
    import="javax.xml.parsers.*,java.io.*,org.w3c.dom.*"%><%@ page import="java.util.*" %>
    !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html> <head> <title>Configuring Xml File</title>
    <SCRIPT LANGUAGE="JavaScript" SRC="xyz.js"> </SCRIPT>
    body bgcolor="#d0d0d0" onClick= "return getDate()" >
    <form name="f1">
    <b>20 october 2006 </b>
    Here where i am printing the date i had to get the value from the js function. how to do that. plz help me....

    Are you talking about server-side java code (servlets/jsp) or client side (applet)? Given we are in the JSP forum I'll assume we're talking server side.
    If so, you are making a common but fundamental mistake. JavaScript executes on the client, not on the server. If you want client data on the server it has to get there somehow. The simplest way to do this in JSP land is via HTTP. So... have your JavaScript code call a JSP (or servlet) and pass the value you want as a URL parameter. Of course this will also change the browser location, so if you don't want this to happen use a frame or iframe to capture your HTTP request.
    For example:
    Javascript....
    function someFunction() {
    return 1;
    var value = someFunction();
    location.href="somejsp.jsp?value=" + value;

  • How to use value returned from a bean in jsp page

    Hi All,
    I have a string array value being returned from a javabean to a jsp page. I want to be able to assign the value to a variable in the jsp page.
    How do I do this?
    Many thanks :)

    thanks for your response.
    I actually used something like this:
    <% String loggedin = log.User(user,password);
    out.println(loggedin);
    %>i am not yet as much of an expert on beans as i would like to be, but i thought it is not really a bean if it has a getter method which takes arguments?

Maybe you are looking for

  • Is there a save function for online forms?

    Hi, I've created an online form which requests quite a lot of information from those who it is sent to.  Because of its size, I have made use of the skip logic rules to so that users can quickly skip sections that don't apply to them.  Notwithstandin

  • Skype call not working

    My skype will not let me call my friend when you call you hear a sound like it pending but i dont hear it and it does it for two people on my skype i dont know what to do? Plz help

  • Setting up php

    i am trying desperately to set up php and can't get there without some serious help on one issue. ive gotten php, phpmyadmin, mysql, and apache running. BUT i can't figure out how to get rid of the following warning that appears on the phpmyadmin hom

  • Error in X11 (unable to start device PNG)

    Hello. I have a problem with running embedded R script. First script runs fine: begin sys.rqScriptCreate('Example1', 'function() { ID <- 1:10 res <- data.frame(ID = ID, RES = ID / 100) res}'); end; The second one is not so fine: select * from table(r

  • Urgent help......can't get rid of adobe icon....

    Hello, I'm using Mac OS X 10.5.8 In my utilities, i discover this There's that Adobe Flash Player Install Manager..........when i click this icon, it's asking me for my password.......which I straightaway click the cancel button, as from the news tod