Using Javascript with SOFIAFramework

Hi everyone,
I'm trying to set one login page designed in JSP, making use of the SOFIA framework. In order to make some validations, i have to use Javascript at the client side itself.
I tried by calling a function(Javascript) on the click of a button. My making use of alert(), i realized that i reached the function. But i got errorwhen i tried to retrieve the value of one text field.
CODE : (Javascript)
function check(){
alert("Inside function");
var name=newForm.username.value;
alert(name);
I got error at the second line of code inside the function and it states that, "newForm.username.value is null or not an object"
Could anyone help ,me to get out of this.

It might even be possible to use Reader XI for filling in the forms and saving the forms. Since this is a free product, then cost would not be an issue. The issues will be the custom files that would need to be installed on each user's system.

Similar Messages

  • Help me!! How to use JavaScript with JSP ??

    I am using JDeveloper and I created a screen in JSP which uses a bean for database connectivity and retriving info onto the page.
    The page has a ListBox where list items are populated from the database.My requirement is
    whenever the list is changed the page shuold be refreshed with the selected item info.
    I tried to use 'JavaScript' for triggering the event with 'onChange' event of the ListBox.But the event is not getting invoked. I think JavaScript is not working with JSP.
    Please help me with how to Use javaScript with JSP or any other alternative where I can meet my requirement.
    I have one more question...I have gone through the JSP samples in OTN and I am trying do download the sample 'Travel servlet' which show list of countries...etc
    I have also gone through the 'readme' but I don't know how to extract .jar file.
    I would be great if you could help me in this.
    Thanks!!
    Geeta
    null

    We have a similar need. We have used Cold Fusion to display data from Our Oracle Database. We have a simple SElect Box in HTML populated with the oracle data. When someone selects say the State of Pennsylvania. then we have an On change event that runs a Javascript to go get all the cities in Pennsylvania.
    Proble we are having is that inorder for the Javascript to work , we currently have to send all the valid data.
    Do you know of any way to dynamically query the the Oracle database in Javascript

  • Use Javascript with InDesign buttons?

    I haven't been able to find ANY info about this anywhere, but I'm wondering if it's possible to call a Javascript function from an InDesign button, instead of link to a web address. This can obviously be done in Flash, but the same syntax that works in Flash does not work in InDesign. I'm not referring to the Scripts panel here - I'm talking about using Javascript with a button created in InDesign. I tried calling a JS function with the GetURL action, to no avail.
    If anybody has ever done this, please post a sample of the correct syntax for a JS function call, as well as which action I should use. Many thanks in advance!

    (Edit: I'm talking about ID CS4/CS5 SWF export, naturally)
    I don't know why, but the following URL (using a global javascript function) seems to work, somehow;
    javascript:alert('testing');
    Arbitrary function names do not work - browser just says "function not defined" - although the same stuff works in Flash. For example;
    javascript:myFunction();
    Also, there seems to be very little info on which (button) properties are included in the SWF export.
    Additional information on the subject would be much appreciated here, too.

  • Using Javascript With Acrobat Forms

    Hello,
    I have been attempting to use Javascript with forms made using Acrobat X Pro. Particularly, I am attempting to use the Font palette with Text fields as described in http://partners.adobe.com/public/developer/en/tips/CalcScripts.pdf .
    One example of this is the Strikethrough property.  TextField1.caption.font.lineThrough = "linethrough" and TextField1.font.lineThrough = "linethrough". I see that "linethrough" is an enumeration (Having values of 0,1, and 2). But I have tried this numerous times, in various ways, and it does not work. I also tried other Font properties and could not get them to work. Is there more setup to this? I am still very much new to developing Forms, and it was frustrating for me to not find a resource that outlined all of the stuff you could do with Forms. My only prior experience with Javascript is for web pages. The pdf I mentioned above seemed promising, but I'm having trouble implementing it.
    I appreciate any help for this!

    For questions about LiveCycle Designer use the forum LiveCycle Designer.

  • Using JavaScript with Acrobat XI Standard

    I am part of a transition team setting up a new correctional facility. I am working with our IT dept to purchase licenses for Acrobat XI. I need to get a definitive answer on using JavaScript with XI standard. The forms I am working with have a variety of scripts mostly button activated. Actions include saving and renaming files to a networked drive. Money is always an issue so if I can use XI standard that would be the better financial choice. The documents will not be created using XI standard just processed.

    This is the Reader forum; the Acrobat one is here:
    http://forums.adobe.com/community/acrobat

  • 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>

  • Using javascript with struts

    hi ,
    i have a jsp page which has a function to be called in javascript,
    if all the values entered are correct, then the details need to be submitted to the action form in struts.
    the coding is like below:-
    <%@ page language="java"%>
    <%@ taglib uri="/WEB-INF/struts-bean.tld"      prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld"     prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld"     prefix="logic"%>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Title</title>
    <link href="css/cherrysoft.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="javascripts/function_client.js" type="text/javascript"></script>
    <script src="javascripts/chgoto.js" language="JavaScript" type="text/javascript"></script>
    <script language="JavaScript">
    function fixSize() {
         buttondiv.style.top =  document.body.offsetTop +(document.body.offsetHeight - buttondiv.offsetHeight );
         contentDiv.style.height = document.body.offsetHeight -  buttonbar.offsetHeight - buttondiv.offsetHeight-14;
         function cancel(obj){
    obj.action="FinanceView.do?do=listBook";
              obj.submit();
         function check_details(obj)
              var frmyear=document.forms[0].fin_fromyear.value;
              var frmmonth=document.forms[0].fin_frommonth.value;
              var toyear=document.forms[0].fin_toyear.value;
              var tomonth=document.forms[0].fin_tomonth.value;
              var yearabbr=document.forms[0].fin_year_abbr.value;
              //alert("From Year : "+frmyear+" frmmonth : "+frmmonth + " : toyear "+toyear+" : to month "+tomonth);
              if(yearabbr.length < 1)
                   alert("The abbreviation field is mandatory");
                   document.forms[0].fin_year_abbr.focus();
              else if(frmyear.length < 1)
                   alert("The from year field is mandatory");
                   document.forms[0].fin_fromyear.focus();               
              else if(frmmonth.length < 1)
                   alert("The from month field is mandatory");
                   document.forms[0].fin_frommonth.focus();
              else if(toyear.length < 1)
                   alert("The to year field is mandatory");
                   document.forms[0].fin_toyear.focus();               
              else if(tomonth.length < 1)
                   alert("The to month field is mandatory");
                   document.forms[0].fin_tomonth.focus();               
              else if(frmyear == toyear)
                   alert("The from and to year cannot be same");
                   document.forms[0].fin_fromyear.focus();
              else if(frmmonth>4)
                   alert("The from month cannot start from "+frmmonth);
              else if(tomonth<3)
                   alert("The to month cannot be less than "+tomonth);
              else if(frmmonth==tomonth)
                   alert("The from month and to month cannot be same");
              else
                   obj.action="FinanceView.do?do=listBook";
                   obj.submit();
    </script>
    </head>
    <body onLoad="fixSize();" >
    <html:form action="/FinanceBeanAdd">
    <div style="height:5%;width:100%" >
         <div id="buttonbar" style="border:0px ;margin-top:0px">
         <table width="100%" cellspacing="0" class="main" >
          <tr>
                   <td class="heading" >Add Financial Year Details</td>
                     <td width="24" background="<%=request.getContextPath()%>/images/bg-titlemid.jpg"></td>
                      <td width="100"  valign="bottom" background="<%=request.getContextPath()%>/images/bgline.gif"></td>
          </tr>
         </table>
         </div>
    </div>
    <DIV id="contentDiv" class="workareadiv"  style="height:85%;width:100%">
    <table width="600px" height="380px" align="center" border"0" cellpadding="0" cellspacing="0">
         <tr>
              <td valign="top">
                   <table border="0"align="center" cellpadding="0" cellspacing="0" >
                        <tr>
                             <td  colspan="2">
                             <table width="600px" height="380px" border="0" align="center" cellpadding="0" cellspacing="0" >
                                  <tr>
                                       <td colspan="3" bgcolor="#FFFFFF">
                                            <tr>
                                                      <td colspan="3" valign="top">
                                       <div  id="enter_details" style=display:block>
                                       <table border="0" bgcolor="#FFFFFF" width="730px" >
    <tr bgcolor="#FFFFFF" class="firstrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>Abbreviation</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_year_abbr" maxlength="7"/></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="secondrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>From Year</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_fromyear" maxlength="4" /></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="firstrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>From Month</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_frommonth" maxlength="2" /></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="secondrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>To Year</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_toyear" maxlength="4" /></td>
    </tr>
    <tr bgcolor="#FFFFFF" class="firstrow">
    <td width='30%' align='left'style="padding-left: 40px" >
    <b>To Month</b><font color='red'>*</font>
    </td>
    <td width='70%'>
    <html:text property="fin_tomonth" maxlength="2" /></td>
    </tr>
                             <tr>
                                                           <td>
                                                           <logic:messagesPresent>
                                                                <ul><font color='red' >
                                                                     <html:messages id="error1">
                                                                          <li><%= error1 %></li>                         </html:messages>
                                                                     </font>
                                                                </ul>
                                                           </logic:messagesPresent>
                                                           </td>
                                                           </tr>
                                                           </table>
                                                           </td>
                                                           </tr>
                                            </td>
                                       </tr>
                                  </table>
                                  </div>
                                  </td>
                             </tr>
                             </table>
                        </td>
                   </tr>
              </table>
    </td>
    </tr>
    </table>
    </div>
               <div id="buttondiv" style="height:10%">
                                                                       <table width="100%" align="left" border="0" cellpadding="3" cellspacing="0"  class="main" >
                                                                     <tr>
                                                                          <td colspan="4" bgcolor="#FFFFFF">
                                                                               <table border="0" cellpadding="2" cellspacing="2" align="left">
                                                                               <tr>
                                                                               <td>
                                                                                    <div align="left" id="save_btn">
                                                                                    <!-- <html:button property="do" value="Save" onclick="check_details(this.form);"/>-->
                                                                                         <!--<html:submit property="do" value="Save"/> -->
                                                                                     <input type="button" value="Save" onclick="check_details(this.form);"%>
                                                                                    </div>
                                                                               </td>
                                                                               <td><div align="left">
                                                                               <html:button property="Cancel" value="Cancel" onclick="cancel(this.form);"/>
                                                                               </div></td>
                                                                               </tr>
                                                                               </table>
              </div>
    </html:form>
    </body>
    </html>
    [/b]the problem right now is when the values are entered the details are not getting stored and it returns to the view.
    pls require someone's help.
    thanks
    sreejith

    I don't see anything at all in that code that has anything to do with JDBC.
    So certainly that code by itself can't store anything in a database.

  • How to validate the phone using Javascript with regularexpression

    Hi ,
    I wanted to validate the phone no with java script regular expression in Sun IDM Xpress code.
    I have written the code like
    <script>
    var bolean = testStr.match(\d{3}-\d{3}-\d{4});
    </script>
    But it not validating and giving the "undefined: illegal character (; line 1)"
    Can any body help me how to validate phone no in the java script regular expression in Sun IDM.
    Thanks in advance.
    Regards,
    Ranjan

    create a javascript rule that include the regular expression validation and call that rule from the filed validation section passing the field value.
    S.

  • Acrobat Reader X : Error using javascript with ProtectedMode on

    Stumped with an issue.
    I have a PDF with a mouseup event to trigger the PDF to SAVE to a network location and it works fine in v9 but with Reader X and enable Protected Mode turned on it throws the following error:
    NotAllowedError: Security settings prevent access to this property or method.
    Doc.saveAs
    I get the above error even though the NETWORK PATH has been added in Reader preferences as a trusted PATH and the web site is listed as a trusted site.
    What am I missing here?

    According to the documentation, I am supposed to be able to setup a POLICY file "ProtectedModeWhitelistConfig.txt" and add parameters to it such as
    FILES_ALLOW_DIR_ANY = c:\tempfiles\*
    FILES_ALLOW_ANY = c:\tempfiles\*
    I want the ability to save to a UNC network path...it worked fine in Acrobat 9 and now with sandbox security and protectedMode in "X" nothing works.
    In Acrobat X, if "enable protected mode" is on, NOTHING works and an error is thrown.  If it is unchecked, the saveAs works fine.

  • Javascript with PL/Sql

    Hi everyone,
    I want to know if it's a good idea to use javascript with PL/sql using HTML-DB (PL) (enabled and disabled button) ?
    Thank you very much. Bye.
    Eric

    I would suggest you pay attention to the base directory where the relative paths for @src and @href make pertinent value pointing to the desired resource.

  • How to use Javascript, C#, or Java to automatically fill out a PDF file using ACROBAT PRO

    Hi.
    I have purchased a copy of acrobat pro and am currently using it to try to create a method of populating certain fields in a PDF file.
    This particualar scenerio is a printable cerficiate, it has a spot for the persons First Name, Last Name, and other basic info.
    So we have an exisiting editable PDF, a database with the user's info, and a ASP.NET web server, and of course Acrobat Pro.
    How can I use these components to create an auto fill script?
    Ideally, we'd genereate these certs on the fly, and allow users to download them.
    A code sample would be awesome.
    Thanks!
    --shawn

    I've discovered that you can create a "PDF Form" and edit that form with Javascript.
    My question now is, what is the prefered method for controlling the pdf form?
    I would like to include the PDF file in an HTML page and edit the form fields using javascript in that HTML page.
    I think that this is how developers are meant to work with dynamic pdf files.
    In the acrobat javascript reference, it only shows an example using the acrobat javascript console.
    If anyone has used Javascript with PDFs, I would highly appricate some input.
    Thanks,
    -- shawn

  • How to use JavaScript in Web bean generated JSP

    I want to do some simple JavaScript validations (for example, checking if a particular field is empty) in the JSP page rendered by the data web bean. Because the HTML is rendered by the bean, I'm not able to refer to the HTML controls in the JSP page. I'm not even able to refer to the form with the following standard piece of JavaScript code - "document.forms[0].control_name".
    Is anybody aware of how to use JavaScript with these rendered JSP pages?

    You just have to add it like and applet , including this line in your JSP or JSF
    <script src="http://dl.javafx.com/dtfx.js"></script>Then add the applet
    <script>
        javafx(
                  archive: "./resources/jar/Draw.jar",
                  width: 400,
                  height: 200,
                  code: "Draw",
                  name: "Draw"
    </script>./resources/jar/Draw.jar - is the path and the name of the jar

  • JavaScript with XHTML pages under the OC4J Oracle Server?

    I make XHTML pages with JavaScript. These are compiling with an OC4J Oracle Server with the component Wireless. And when i look at the code source of my page the JavaScript never appears.
    So, do you have a solution to use JavaScript with these conditions , please?

    We do not currently support the use of Javascript through the Multi-channel Server.
    However, there may be a workaround. If you use a different MIME type (i.e. text/html) for specific pages that contain Javascript, you can bypass the Multi-channel Server. The Multi-Channel Server will simply passthrough pages with MIME types other than MobileXML, XHTML MP, or XHTML+XForms.
    Regards,
    Phil

  • 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)"/>

  • Using Javascript to rasterize a layer and maintain its position with other layers.

    Trying to use javascript to rasterize just the contents of a certain layer by its name.
    It needs to maintain its position.
    I've sort of cobbled a script, but it keeps moving the rastered art to the top layer.
    Ex, top down i have Layer 4, RasterizeMe, Layer 2, Layer 1. 
    The rastered contents end up on Layer 4
    Any help would be apprecieated, or if theres a better method of doing this.
    //  Rasterize Layer by name
        if ( app.documents.length > 0 ) {
            doc = app.activeDocument;
            if(!doc.saved){
                Window.alert("This script needs to modify your document. Please save it before running this script.");
            }else{
                createRasterLayer(doc);
        }else{
            Window.alert("You must open at least one document.");
    function createRasterLayer(doc){
        var totalLayers = doc.layers.length;  //get the total number of layers in the active document
        for ( var i = 0 ; i < totalLayers ; i++){  //looping through layers            
            var currentLayer = doc.layers[i];
            var tempItem;
            if(currentLayer.visible == false) continue;   //We don't want to deal with hidden layers
            currentLayer.locked = false;                       //Unlock the layer if needed
            var layerName = new String( currentLayer.name );
            if ( layerName.indexOf("RasterizeMe") == 0 ) {
                currentLayer.hasSelectedArtwork = true;   //Select ALL in the layer
                if(doc.visibleBounds[2] == 0) continue;   // ignore empty layers
                var newoptions = new RasterizeOptions; 
                newoptions.resolution = 350;
                if ( doc.selection.length > 0 ) {
                    newGroup = app.activeDocument.groupItems.add();
                    for ( z = 0; z < doc.selection.length; z++ ) {
                        doc.selection[z].move( newGroup, ElementPlacement.INSIDE);
                    doc.rasterize (newGroup, newGroup.visibleBounds, newoptions);

    you're adding the group to the document, it will be the top most object on the top most layer
    newGroup = app.activeDocument.groupItems.add();
    use this to add the group to the current layer
    newGroup = currentLayer.groupItems.add();
    or if theres a better method of doing this.
    I would
    - loop through all layers,
    - hide them all, except the one you want to rasterize,
    - Rasterize the document
    - unhide layers

Maybe you are looking for

  • Need a substitue for OrionPooledDataSource **ClassCastException **

    Hi we are getting a "null, java.lang.ClassCastException" when executing the following: InitialContext ic = new InitialContext(); Object o = ic.lookup("jdbc/od_jdbc_connectionPooledDS"); OracleConnectionPoolDataSource ds = (OracleConnectionPoolDataSou

  • Can i have 2 screens go Full screen

    I am trying to get my second screen to go full screen as well when running full screen apps. Can this be done?

  • JDev 11r1 minor bug in Subversion Import Wizard

    Hi all, When performing the initial import of an application into a Subversion repository, on step 4 of 6 of the import wizard (Filters), there is a minor UI bug. Both the "New" button (for adding a new ignore filter) and the "Next" button (for going

  • Reg: File Extraction from SAP Queries via background job

    Hi , Is it possible to Extract a file to the presentation Server by running the ABAP Query's through SQ01 as a back ground job to generate a file automatically without running it manually. I have tried recording the query's thru SQ01 with the File st

  • Delete unnecessary data in info objects by using a process chain

    Hi Guru's I need to make a process chain which deletes data which is not used within an info object. I know how to delete the  master data which is not used for an info object. But I want to make a chain for this so I can run this chain so all not us