How jsp to use javascript's variable??

Hi, how jsp to use javascript's variable or a jsp's variable can be assigned a value in the javascript??
thx

well i havent accessed the value of javascript variable in jsp
yet but i have accessed the value of a java variable in java script
try it
<script ...>
function jspToJavaScript(a){
alert(a);
</script>
<%
int a=10;
%>
<img src="..." onClick="jspToJavaScript(<%=a%>)">

Similar Messages

  • How can i use javascript in weblogic jsp

    Hai,
              I know that we can use the jsvascript to validate the html parameters.
              Is the wblogic jsp support the javascript ?. I tried in weblogic
              5.1.0.,the javascript is not working.
              anybody can help me how to validate html input and how can i use
              javascript in jsp.
              Thanks
              Srinivas
              

              Do you know how JSP can use a variable defined in Javascrip ?
              Thx,
              Lin
              "Cameron Purdy" <[email protected]> wrote:
              >Write your JSP as you would any HTML file, including JavaScript. Then
              >rename the .html file to .jsp. Add your custom tags and Java code as
              >desired. Done.
              >
              >There was a complaint in the 5.0 beta about the JSP parser choking on
              >JavaScript, so I would make sure you at least try on the latest 5.1 service
              >pack, just in case.
              >
              >Cameron Purdy
              >
              >"SRINIVAS" <[email protected]> wrote in message
              >news:[email protected]..
              >> Hai,
              >> I know that we can use the jsvascript to validate the html parameters.
              >>
              >> Is the wblogic jsp support the javascript ?. I tried in weblogic
              >> 5.1.0.,the javascript is not working.
              >> anybody can help me how to validate html input and how can i use
              >> javascript in jsp.
              >>
              >> Thanks
              >> Srinivas
              >>
              >
              >
              

  • How can I use javascript in a Text Area with HTML editor??

    My question is... how can I use javascript in Text Area with HTML editor??
    I can use javascript functions that change the content of Text Areas but i can´t if i try in text area with html editor....
    I need to limit number of characters in a text area with html editor and i can´t.
    could anybody help me please?

    I have been experiencing similar problems with the HTML Editor and have managed to find an answer that should start to answer some of my questions. The Apex HTML Editor Standard is actually an HTML editor called FCKeditor. The FCKeditor has a Javascript API that can be found at http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/JavaScript_API. Unfortuately this doesn't seem to give the whole answer and I found more at http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:49607.
    I needed to get the text entered within my html editor standard (e.g. P1_MYTEXT) and use it within my javascript function. I did this by using the following script
    <script language="JavaScript" type="text/javascript">
    function showtext(){
    var oEditor = FCKeditorAPI.GetInstance('P1_MYTEXT');
    var editortext = escape(oEditor.GetXHTML(oEditor.FormatOutput));
    alert(editortext);
    </script>
    Hope this helps.
    Matthew

  • How to create/use SAP Exit variable of Query designer

    Hello experts,
    Can you please guide me on how to create/use SAP Exit variables ?
    Is there any way we can transport customer exit include in which we write all codes related to customer exit variables?
    Kindly provide your valuable inputs on this.
    Thanks,
    Mitesh

    Hello Gautam,
    I think you should first implement the user-exit via the transaction SMOD/CMOD and the SAP-Enhancement RSR00001 User-Exit ( BW Reporting )
    For the concrete implementation I would suggest to encapsulate the variables, as it is described here
    Easy implementation of BEx-Userexit-Variables
    and here: BEx-Userexits reloaded
    Kind regards,
    Hendrik

  • How do I define javascript global variables to use across windows

    I have a number of web pages. I have javascript for each page. I need to share some data across the web pages. How do I define javascript variables that can be accessed from multiple web pages?

    Use SugarSync.

  • How can i use JavaScript in Struts

    Any one can please tell me how can i use simple java script in Struts framework
    like
    <script language="javascript">
    function call()
    alert("You Are In call()")
    </script>
    </head>
    <body>
    <form ..... >
    <input type="button" value="CHECK" onclick="return call()" >
    </form >........
    ok this i can use in normal jsp
    but how can i use same in Struts framework
    Thanks in advance

    This forum is for JSF, not Struts. Your best bet to get your question answered, is to post to the struts user mailing list.

  • How do I use an array variable in the assignment target?

    Hi,
    I am creating a BPEL process in which I have to use an array variable. The array variable needs to be initialized based on some condition.
    The issue is I cannot find a way to set the value of the array variable. There are ways to GET the value of an array variable indexing into it.
    But how do I set the value by using the Array variable in the <to> tag?
    Any help is appreciated. I am using BPEL 10.1.2.0.2.
    Thanks.

    You can declare a variable of type integer which will server as your index. Figure out based on some condition in your process which index of array to update. Assign to your integer variable you created.
    And have Assign copy operation like this -
    <copy>
    <from variable="Var_Output_FetchDueDate"
    part="OutputParameters"
    query="/ns18:OutputParameters/ns18:DUEDATE"/>
    <to variable="outputVariable" part="payload"
    query="/client:GetCustomerAccountInformationProcessResponse/client:customer/client:accounts/client:account[$Var_Counter]/client:dueDate"/>
    </copy>
    I have been using this in my processes.

  • How to SIMPLY use the %DIMENSION_TO_SET% variables into logic scripts

    hello,
    I'm using a prompt of type "COPYMOVE" or "COPYMOVEINPUT". In this type of prompt, there are 2 columns of dimension members list, one for defining the "source zone" and one for defining the "target zone" of logics.
    The left colum of the prompt (for source zone) feeds the variables %DIMENSION_SET% : %ACCOUNT_SET%, %ENTITY_SET%, %CATEGORY_SET%, etc...and these variables can be used in the logic scripts in *XDIM_MEMBERSET instructions for example.
    The right colum of the prompt feeds the variables %DIMENSION_TO_SET% : %ACCOUNT_TO_SET%, %ENTITY_TO_SET%, %CATEGORY_TO_SET%, etc...and I don't know how to SIMPLY use these variables in the logic scripts.
    I've found a tricky way to do that but I meet 2 problems :
    - it is complicated
    - the multi-info instruction (BEGININFO/ENDINFO) seems to be bugged as blank lines are added all the time in the code and sometimes I have to wait for minutes when I try to modifiy the package code through BPC for excel eData/modify package menu.
    So the question is how to SIMPLY get the %DIMENSION_TO_SET% variables into logic scripts and use them ? Thanks, R.
    Here is the tricky package code I use at this time (I build one function for each %DIMENSION_TO_SET% variable and I pass these functions to the logic) :
    PROMPT(COPYMOVE,,,,"ACCDETAIL,ACCOUNT,CATEGORY,DATASRC,ENTITY,TIME,YEARS")
    TASK(Execute formulas,USER,WS-WW\PlauchuR)
    TASK(Execute formulas,APPSET,US)
    TASK(Execute formulas,APP,SV)
    TASK(Execute formulas,SELECTION,D:\BPC\Data\WebFolders\US\SV\PrivatePublications\PlauchuR\TempFiles\FROM_1561_.TMP)
    TASK(Execute formulas,TOSELECTION,D:\BPC\Data\WebFolders\US\SV\PrivatePublications\PlauchuR\TempFiles\TO_1561_.TMP)
    BEGININFO(%FSS%)
    *FUNCTION TARGETACCDETAIL=%ACCDETAIL_TO_SET%
    *FUNCTION TARGETACCOUNT=%ACCOUNT_TO_SET%
    *FUNCTION TARGETCATEGORY=%CATEGORY_TO_SET%
    *FUNCTION TARGETDATASRC=%DATASRC_TO_SET%
    *FUNCTION TARGETENTITY=%ENTITY_TO_SET%
    *FUNCTION TARGETTIME=%TIME_TO_SET%
    *FUNCTION TARGETYEARS=%YEARS_TO_SET%
    ENDINFO
    TASK(Execute formulas,FORMULASCRIPT,%FSS%)
    TASK(Execute formulas,LOGICFILE,D:\BPC\Data\WebFolders\US\SV
    ..\AdminApp\SV\_TEST.Lgf)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    Edited by: ALEXANDRE BEDIER on Jun 16, 2010 3:15 PM

    hello,
    finally I've discovered that there is no need of BEGININFO instruction.
    One can pass several functions to a logic with one FORMULASCRIPT task. The functions definitions have to be separated by instructions. See below :
    PROMPT(COPYMOVEINPUT,%FTARGETS%,,"select source and target zone for category and datasource.","ACCDETAIL,ACCOUNT,CATEGORY,DATASRC,ENTITY,TIME,YEARS")
    TASK(Execute formulas,FORMULASCRIPT,*FUNCTION TACCDETAIL=%ACCDETAIL_TO_SET% *FUNCTION TACCOUNT=%ACCOUNT_TO_SET% *FUNCTION TCATEGORY=%CATEGORY_TO_SET% *FUNCTION TDATASRC=%DATASRC_TO_SET% *FUNCTION TENTITY=%ENTITY_TO_SET% *FUNCTION TTIME=%TIME_TO_SET% *FUNCTION TYEARS=%YEARS_TO_SET%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\_TEST.LGF)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    Then one will be able to use the functions TACCDETAIL, TCATEGORY, TACCOUNT,... in the logic script.
    Edited by: ALEXANDRE BEDIER on Jun 24, 2010 10:31 AM
    Edited by: ALEXANDRE BEDIER on Jun 24, 2010 10:33 AM

  • How do I use Javascript to populate a text field based on a selection from a drop down box?

    Greetings,
    I have virtually no experience with JavaScript and I am trying to figure out how to add some basic automation features to an Adobe form.  I have a drop down box called "Hospital_Name" that will contain approximately 7 possible selections.  When the user makes a selection, I would like to have the text field (called "Hospital_Address") below the drop down box populate with the corresponding address for the selection.  I have the "Hospital_Address" text field configured for multiple lines and would like the address to have a line break between the street address and the city/state/zip.
    For example, if the user selected "Hospital 1", the text field would display:
    123 Main St
    Anytown, CA 12345
    Any help or examples you can provide would be greatly appreciated.

    You have the element names within the object within brackets.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    // some debugging code to see location names;
    console.show();console.clear():
    for(I in Location) {
    console.println(I);
    // end debugging code;
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;
    This is not a beginners task but requires a fair amount of knowledge about the structure of objects, defining strings, and structure of arrays.
    Are you sure you have all the field names correctly spelled and capitalized?
    Do you get any error in the JavaScript console?
    Just trying the line that defines the "Location", I get the following error:
    SyntaxError: invalid property id
    1:Console:Exec
    undefined
    All the form field in a PDF are processed by using JavaScript and any error in any script will stop JavaScript processing.
    It might help to have a link to the problem form.
    Make sure your brackets are properly placed and matched.
    // Place all pre-population data into a single data structure
    var Location = {
    "--Hospital--":{ line1: " ", line2: " " },
    "Bellevue Medical Center":{ line1: "2500 BMC Drive", line2: "Bellevue, NE 68123" },
    "CHI Bergan Mercy":{ line1: "7500 Mercy Road", line2: "Omaha, NE 68124" }, 
    "CHI Immanuel":{ line1: "6901 N. 72nd Street", line2: "Omaha, NE 68122" }, 
    "CHI Lakeside":{ line1: "16901 Lakeside Hills Court", line2: "Omaha, NE 68130" }, 
    "CHI Midlands":{ line1: "11111 S. 84th Street", line2: "Papillion, NE 68046" },
    "Creighton University Medical Center":{ line1: "601 N. 30th Street", line2: "Omaha, NE 68131" },
    "Nebraska Medical Center":{ line1: "4400 Emile Drive", line2: "Omaha, NE 68105" }
    function SetFieldValues(Hospital_Name) {
        this.getField("AddLine1").value = Location[Hospital_Name].line1;
        this.getField("AddLine2").value = Location[Hospital_Name].line2;

  • HOW I CAN USE JAVASCRIPT IN 11GFORMS

    ANY EXAMPLE / TUTORIAL / SAMPLE?

    Hi,
    Here is an example of how to call a javascript function
    1. Drag and drop a hyperlink component
    2. Click on the JSP tab to go to the JSP source editor
    3. Insert the following block of javascript code in the ui:head tag
    <script type="text/javascript">
                            function popup() {
                            alert("Hello World")
    </script>4. Return to the design editor
    5. Select the hyperlink component
    6. In the properties sheet, under the section Javascript, click on the ... button next to the onClick property
    7. A dialog window pops up. Enter the following line
    popup();
    8. Click on OK
    9. Save and run the application
    10. When the page is rendered click on the hyperlink and an alert saying Hello World appears
    Hope this helps
    Cheers
    Girish

  • How can I use Server level variables in a business model based report

    hi gems..
    I have declared one server level variable in the BI Analytics repository.
    Now I have made one business model based report.
    In one column I want to use that server level varible.
    I go to the formula tab of that column and then clicked on variable--> session --> put the name of the variable and click ok.
    But when i viewed the report, it is not showing the dates, rather it is showing the date format I chosed i.e DD-MMM-YYYY.
    please help..

    actually the previous problem got resolved...
    Now when I am trying to apply a filter on a particular column using that server variable, then it is showing that the varible has no value definition.
    I have clicked on the filter tab of that column-->add-->variables-->session variables-->then I put the name of the variable-->click OK.
    the following error is comming-
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 23005] The repository variable, Variable_name, has no value definition. (HY000)
    I have made that server variable from manage-->variables-->(right click) create new initialisation block-->gave the name and wrote the query and aslo gave the connection pool name and test that and it worked fine..

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • How does one use JavaScript with the Windows Media Player Plugin?

    Hi there.
    According to this old [http://msdn.microsoft.com/en-us/library/dd564570%28v=VS.85%29.aspx MSDN Article] it is possible to control the windows media player plugin using javascript.
    It provides a series of objects off the object that should perform certain funtions, such as play stop and seek.
    It states very clearly in the article that some are not supported; however, none of them seem to be working with the latest version(s?) of Firefox.
    I have Firefox 5 installed currently and have not tested in any other version, so I'm not sure when it stopped working.
    The video does load and will display properly -- the ability to control it through javascript however, does not work.
    i.e.:
    var mplay = document.getElementById('myplayer');
    mplay.controls.play(); // mplay.controls is undefined
    This same code works in Internet Explorer.

    You need to place the URL in a data attribute for Firefox.
    <pre><nowiki>document.write(' <OBJECT id="Player" data="http://87.117.197.189:16229" width="320" height="45" type="application/x-ms-wmp">');
    document.write(' <param name="AudioStream" value="true">');
    document.write(' <param name="Enabled" value="True">');
    document.write(' <param name="ClickToPlay" value="false">');
    document.write(' <param name="BufferingTime" value="5">');
    document.write(' <param name="ShowDisplay" value="False">');
    document.write(' <param name="Volume" value="70">');
    document.write(' <param name="autoStart" value="true">');
    document.write(' </OBJECT>');</nowiki></pre>

  • How we can use Business Contained Variable

    Hi All,
    I want to use Business Contained Variables which is already using in other BW report, can any body tell me navigation Part.
    Thanks & regards
    Premansh Gupta

    Hi,
    you said that the same variable is already being used in other queries?
    where are you searching for variable list?
    after opening the Query,find the characteristic in the left window (from dimension tree) and expend it and expand 'charateristic value variables'..here you will find all the variables associated with the char.
    what is the characteristic? and whats the variable you are looking for?

  • How  can  I use Javascript code to affect the display of textField?

    Hi All,
    I created a web application using JSF.
    And Placed two controls: one Text Field and one Label.
    On the Javascript onclick event of Label, I wrote the following javascript:
    document.getElementById("form1:textField1").value="test123";
    I run the web application, and click on the label, However, the text of the Text Field does not change.
    But the following code shows text of the Text Field has been changed. it works.
    alert(ocument.getElementById("form1:textField1").value);
    So, why the display of the Text Field does not change? How to update the display of the Text Field?
    Any suggestion will be helpful!
    Thank you.

    here is a full and correct example, enjoy
    1. <html>
    2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    3. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    4. <f:view>
    5. <head>
    6. <title>
    7. <h:outputText value="#{msgs.windowTitle}"/>
    8. </title>
    9. </head>
    10. <body>
    11. <h:form id="registerForm">
    12. <table>
    13. <tr>
    14. <td>
    15. <h:outputText value="#{msgs.namePrompt}"/>
    16. </td>
    17. <td>
    18. <h:inputText/>
    19. </td>
    20. </tr>
    21. <tr>
    22. <td>
    23. <h:outputText value="#{msgs.passwordPrompt}"/>
    24. </td>
    25. <td>
    26. <h:inputSecret id="password"/>
    27. </td>
    28. </tr>
    29. <tr>
    30. <td>
    31. <h:outputText value="#{msgs.confirmPasswordPrompt}"/>
    32. </td>
    33. <td>
    34. <h:inputSecret id="passwordConfirm"/>
    35. </td>
    36. </tr>
    37. </table>
    38. <h:commandButton type="button" value="Submit Form"
    39. onclick="checkPassword(this.form)"/>
    40. </h:form>
    41. </body>
    42. <script type="text/javascript">
    43. <!--
    44. function checkPassword(form) {
    45. var password = form["registerForm:password"].value;
    46. var passwordConfirm = form["registerForm:passwordConfirm"].value;
    47.
    48. if(password == passwordConfirm)
    49. form.submit();
    50. else
    51. alert("Password and password confirm fields don't match");
    52. }
    53. -->
    54. </script>
    55. </f:view>
    56. </html>

Maybe you are looking for

  • Events not showing in iCal, but do on my iTouch Calendar

    I am syncing my iCal 3.0.7 with GoogleCalendar using Calgoo connect 2.1.3. It uploads new events to my gCal, but if I create new events in gCal, they won't show up on iCal. I thought this was a Calgoo problem, but when I sync my iTouch with my comput

  • What is the best external hard drive for a macbook pro?

    I have a lot of music, pictures, and software like Massive, Logic Pro 9 and FireStudio. Can the software be backed up to an external hard drive as well?

  • Workflow Directory does not found in Sybase Directory

    Hello Experts,       I am using workflow for Blackberry Device, and through tutorial i have to copy Few files from "C:\Sybase\UnwiredPlatform\ClienAPI\Workflow\BB" to my Blackberry Simulator Directory, but in My Sybase directory i didn't found that f

  • QT mov files stutter in PPro

    I have several animation files that just came in as QT files for use in PPro 1.5.  They play fine in QT Player,, but stutter when in PPro.  None are larger than 450MB.  I thought QT mov files were compatible with PPro.  What am I missing here?  I tri

  • CS4 Error message 150 : 30

    I can no longer open CS4 on Mac OS 10.8.  I upgraded some months ago to OS 10 and this is the first time I've needed to use it for some months as I'm usually in LR 5. It just won't open - should I reload although I've probably lost the registration k