Javascript function not working

Hi I am new in development.
Could you tel me what problem may be in my jsp code.
previously my .jsp file have some javascript functions all was working properly. Now i have made changes on one function which was working properly but now it is not working and the after clicking the button to which it is associated no action is taking place. .What may be the problem
Thanks with regards

The problem would be that you have introduced a syntax/runtime error into your javascript code with your changes.
Unfortunately my mind reading powers are not working today, so I can't tell you exactly which line of code it is that you have broken.
Maybe if you posted some code? (note I say some and not all) If you paste your whole page here unformatted, don't expect any help.
Debugging javascript is not a nice thing to do.
Try getting Mozilla/Firefox - it has a javascript debugger integrated with it.
Myself I normally go along the lines of alert("step1") alert("step2") peppered through the javascript code. At the point the alerts stop, is where I focus my attention to find the error.
Good luck,
evnafets

Similar Messages

  • Javascript function not working in IE but in Firefox

    Dear fellow developers and pros, I have a huge problem with the following function. While it works perfectly in Firefox, the Internet Explorer (my special friend) doesn't interpret the code correctly. At least this is my guess. The message box appears but the UPDATE process is not carried out and the application procedure "proc_delete_mx" is not carried out either. Only the redirect works!
    I need to get it to work in IE, as a lot of end users depend on the IE and are restricted to use alternative browsers.
    Can you please help me on this one!??? You're my last hope as I have already tried to paste this function into several template regions. In the past it used to work for jQuery code not interpreted by the IE.
    <script type="text/javascript">
      function warning1(){
        var lValue = $v('P231_CHECK_CE_STATUS');
        var pValue = $v('P231_INT_STATUS');
        if(lValue*1 > 0 && (pValue == 1 || pValue == 2 || pValue == 5 || pValue == 6 || pValue == 7 ) )
          $('#dialogwarning').dialog('open');
    else
          doSubmit('UPDATE');
          redirect('f?p=105:18:&APP_SESSION.::NO:');
    $(function(){
      $("#dialogwarning").dialog({
        autoOpen: false,
        bgiframe: true,
         modal: true,
            width: 400,
            minWidth: 400,
            resizable: true,
         buttons:
    {Speichern: function()
    var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=proc_delete_mx',0);
    gReturn = get.get();
    get = null;
    doSubmit('UPDATE');
    $(this).dialog(redirect('f?p=105:18:&APP_SESSION.::NO:'));     
    Abbrechen: function(){
    $(this).dialog('close');
    </script>
    <div id="dialogwarning" title="Achtung!">
    <p>
    <span class="ui-icon ui-icon-alert" style="float:left; margin:0 10px 40px 0;"></span>Es liegen bereits gutachterliche Bewertungen für diesen LRT vor.
    Wenn der Status geändert wird, werden alle gutachterlichen Bewertungseinstellungen und Ergebnisse verworfen.</p>
    </div>A million thanks for your answers!
    Regards,
    Seb

    Okay, I eventually found the bug myself and was able to fix it.
    The Internet Explorer 8 simply doesn't like a doSubmit followed by a straight redirect!
    doSubmit('UPDATE');
               redirect("f?p=&APP_ID.:1:&SESSION.");How I solved it??
    I created two custom pl/sql update procedures, which I'm calling in javascript with doSubmit.
    doSubmit('UPDATE_CUSTOM1');Additionally I created two new branches directing to the desired pages and set them to be conditional.
    Now the branches are taken after the request of my update procedures has been issued.
    Furthermore, I have no more problems with binding page items on subsequent pages, since the branches are doing it.
    Hope it helps!
    Regards,
    Seb

  • Javascript function not working in template-based html files

    Does anyone have any insight as to why the following function works only in the .dwt file but not in the related html files?
    *Note: it only works in the dwt file if I change the path of:
    var imgs = new  Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    to
    var imgs = new  Array(../'images/header1.jpg',../'images/header2.jpg',../'images/header3.jpg');
    but with the paths reading correctly (as below) in the html files it still doesn't work...
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    var delay = 7500;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    </head>
    <body onLoad="preloadImgs();randomImages()">
    Any help would be appreciated!
    Andy

    Wow - now I have a real doozy for you. That duplicate function has generated itself all on its own. The script in the template file is:
    <script type="text/javascript">
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    function MM_swapImgRestore() { //v3.0
      var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    // Comma separated list of images to rotate
    var imgs = new Array('images/header1.jpg','images/header2.jpg','images/header3.jpg');
    // delay in milliseconds between image swaps 1000 = 1 second
    var delay = 5000;
    var counter = 0;
    function preloadImgs(){
      for(var i=0;i<imgs.length;i++){
        MM_preloadImages(imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
      MM_swapImage('rotator', '', imgs[counter++]);
      setTimeout('randomImages()', delay);
    </script>
    As you can see - no duplication.
    For some inexplicable reason, this is being added in to all the html pages based on the template:
    MM_swapImage('rotator', '', imgs[counter++]imgs[i]);
    function randomImages(){
      if(counter == (imgs.length)){
        counter = 0;
    Which explains why it works in the template file but not in any the html files. Of course, because the code is not in an editable region, I can't remove it manually from the html files. Have you ever heard of code generating itself in this manner? Or how to solve it?

  • Javascript function not working in LiveCycle

    I've just completed importing an existing acrobat form into LiveCycle for editing.  During the import process, I received this LiveCycle warning:
    The form includes a simple JavaScript Function that looks really good, but probably doesn't reference the correct objects in the form. Here's the Code:
    topmostSubform.Page1.Text1::calculate - (JavaScript, client)
    (function() {
    var v1 = Number(this.getField ("MinutesRow1").value);
    var v2 = Number(this.getField ("MinutesRow2").value);
    var v3 = Number(this.getField ("MinutesRow3").value);
    var v4 = Number(this.getField ("MinutesRow4").value);
    var v5 = Number(this.getField ("MinutesRow5").value);
    var v6 = Number(this.getField ("MinutesRow6").value);
    var v7 = Number(this.getField ("MinutesRow7").value);
    var v8 = Number(this.getField ("MinutesRow8").value);
    var v9 = Number(this.getField ("MinutesRow9").value);
    var v10 = Number(this.getField ("MinutesRow10").value);
    var v11 = Number(this.getField ("MinutesRow11").value);
    var v12 = Number(this.getField ("MinutesRow12").value);
    var v13 = Number(this.getField ("MinutesRow13").value);
    var v14 = Number(this.getField ("MinutesRow14").value);
    var v15 = Number(this.getField ("MinutesRow15").value);
        //perform the calculation
        var result = (v1+v2+v3+v4+v5+v6+v7+v8+v9+v10+v11+v12+v13+v14+v15)/60;
        //set the value of this field to the result
        event.value = result;
    The object references seem to be correct, and the code seems solid. Does anyone have any ideas?

    Hi.
    AcroForms (forms created in Acrobat) use a version of JavaScript that is close to Code JavaScript. So syntax like this.getField are specific to AcroForms.
    XFA Forms (forms created in LiveCycle Designer) are completely different. The version of JavaScript has subtle but important differences.
    For example, "this" in AcroForms means the document, whereas in XFA Forms, "this" refers to the object that contains the script.
    Have a look here at an example that explains how to reference objects in LC Designer: http://assure.ly/kUP02y.
    So for example:
    function myFunction () {
    var v1 = MinutesRow1.rawValue;
    // the rest of the variables
    var myResult = (v1+v2+v3+v4+v5+v6+v7+v8+v9+v10+v11+v12+v13+v14+v15)/60;
    return myResult;
    Good luck,
    Niall

  • Client Side Javascript Validation not Working in Struts 1.x version

    hi,
    I'm following the steps provioded in the below link for Javascript Client side validation but still it is not working.I'm struggling to get this work.
    [http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/|http://www.visualbuilder.com/jsp/struts/tutorial2/pageorder/9/]
    "The framework automatically generates the browser specific JavaScript and validate the data only at the client side."From the above statement i undertstand that framework itself generates the javascript function for validating the field mentioned in validations.xml file so that we dont have to explicitly write a javascript function for
    validating the fields
    (or)
    Do we need to call an explicit function
    Please need help on this.
    I have followed all the steps mentioned on the above link but Client Side Javascript Validation not Working in Struts 1.x version....
    Thanks and Regards,
    Deepak

    Hi,
    Please find my steps below....still getting an error.
    2> which version of commons-validation.jar needs to be downloaded ...Link please
        downloaded the latest commons-validation.jar and placed in lib.refreshed the project,and did a build.
        3> which DTD name to be specified in "validator-rules.xml" which is in accordance to commons-validator.jar file.
    validator-rules.xml ::
    <!DOCTYPE form-validation PUBLIC
              "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
              "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">validation.xml:
    <!DOCTYPE form-validation PUBLIC
    "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
    "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
    i did as u said and im gettiong the below errorNov 5, 2009 4:33:08 PM org.apache.struts.validator.ValidatorPlugIn initResources
    SEVERE: Invalid byte 2 of 2-byte UTF-8 sequence.
    org.apache.commons.digester.xmlrules.XmlLoadException: Invalid byte 2 of 2-byte UTF-8 sequence.
         at org.apache.commons.digester.xmlrules.FromXmlRuleSet.addRuleInstances(FromXmlRuleSet.java:139)
         at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610)
         at org.apache.commons.digester.xmlrules.DigesterLoader.createDigester(DigesterLoader.java:89)
         at org.apache.commons.validator.ValidatorResourcesInitializer.initialize(ValidatorResourcesInitializer.java:122)
         at org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:238)
         at org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:181)
         at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1036)
         at org.apache.struts.action.ActionServlet.init(ActionServlet.java:455)
         at javax.servlet.GenericServlet.init(GenericServlet.java:212)
         at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
         at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
         at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
         at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:927)
         at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:890)
         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1150)
         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
         at org.apache.catalina.core.StandardService.start(StandardService.java:448)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
    Need help forum members.....
    Please reply to my question 1  which has been asked before as belowDo i need to write explicit javascript function for validation in Struts (or) struts generates the javascript function by itself.??? Please explain with an example....
    Edited by: Deepak_A_L on Nov 5, 2009 4:37 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Not able to sign into Blackberry Protect. Backup and Restore function not working. "Your device isn't associated with a Blackberry ID"

    Not able to sign into Blackberry Protect.  Backup and Restore function not working. Message is: "Your device isn't associated with a Blackberry ID."  My Blackberry Messenger and Blackberry World is working fine so I am sure its not an ID issue on the phone.  I can sign into Link, Blackberry.com and Protect.  I see my device in Protect but cannot send messages or view it on a map.  Times out with cannot reach device message.  BB Protect on Device has a swirling circle beside the on/of switch.  Cannot turn off.  
    I have deleted Link and re-installed.
    I have reset phone to default(factory) and signed in. 
    OS level is 10.2.1.3062
    BB Link is 1.2.3.56
    Solved!
    Go to Solution.

    I managed to figure this out myself. I had to delete the device from the Blackberry Protect website.  protect.blackberry.com.  I wiped my device again and signed in with my Blackberry ID.  I dont know if the step of wiping was necessary as I did not try my backup with the current configuration on the device following the delete.  Restore is in progress for me!

  • Javascript is not working in JSP

    Hi everybody,
    My javascript is not working in JSP.I m not able to fix this problem.Please tell where the problem in code.
    thx in advance.
    <%@page import="javax.servlet.http.*" %>
    <%@page import="java.sql.*" %>
    <html>
    <head>
    <script type="text/javascript" >
    funtion checkentries()
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)
    alert("Please fill all entries")
    else
    document.LForm.submit()
    </script>
    </head>
    <body>
    <table width=100% height=100% valign="center" align="center" border=0>
    <tr height=10% ><td>
    <%@ include file="Header.jsp" %>
    <hr>
    </td></tr>
    <tr height=1% width=100%>
    <td align=right>Register
    <hr>
    </td>
    </tr>
    <tr height=77% width=100% ><td>
    <table>
    <tr><td width=65%>
    </td>
    <td bgcolor="black" width="1" ></td>
    <td align="right" valign="top" >
    <form method="POST" action="/EIS/Home.do" name="LForm">
    User Name: <input type="text" align=right name="uname"><br>
    Password: &nbsp&nbsp&nbsp<input type="password" name="upassword"><br>
    <input type="submit" name="submit" value="Submit" onclick="checkentries()">
    </td>
    </tr>
    </table>
    </td></tr>
    <tr height=10% ><td>
    <hr>
    <%@ include file="Footer.jsp" %>
    </td></tr>
    </table>
    </body>
    </html>

    in this part:
    if(document.LForm.uname.value==null || document.LForm.upassword.value==null)should be:
    if(document.LForm.uname.value=="" || document.LForm.upassword.value=="")or
    if(document.LForm.uname.value.length==0 || document.LForm.upassword.value.length==0)

  • Copy/paste function not working in Firefox 22. Always good in previous versions

    Copy/paste function not working in Firefox 22. Always good in previous versions editions

    Well I've uninstalled FF22, thanks for the suggestion.
    Chrome works perfectly with ZA and C&P.

  • Why is the scroll function not working after accessing the voice feature in settings?

    Why is the scroll function not working after accessing the voice feature in settings?

    For some prerecorded audio files the Transpose slider will not work reliably. I found no clear pattern, when it does and when not.
    If all fails, create a loop from the audio file. Select the region in the track and use the command "File: Add region to Loop library".
    Set the current key and tempo, name the loop, and save the loop.
    Now add it from the loop browser to a new track and delete your old track. The search field in the Loop browser will help you to find the loop quickly.
    You will be able to transpose the sample as described above, like a regular loop.
    For example - a audio file turned into a loop and transposed:

  • MDX -Children count function Not working in Case statement

    Hi,
    I am trying to create set when you slice with the Hierarchy member is leaf level , I want a output only that Leaf level .
    and When I slice with  the parent level , it has to give all the members below that parent level.
    But the problem here is when I select child member or leaf member , The first condition in the Case is not working
    WITH SET
    TESTSET AS
    CASE
    WHEN
     [Dimension].[Hierarchy].currentmember.children.count<0
    THEN
     [Dimension].[Hierarchy].currentmember
    ELSE
     DESCENDANTS([Dimension].[Hierarchy].Currentmember,,AFTER)
    END
    SELECT
    WBSSET ON 1,
    {} on 0
    FROM
     (SELECT {[Dimension].[Hierarchy].&[10]} ON COLUMNS FROM [CubeName])
    Thanks,
    Santosh

    Hi Santosh,
    I don't think Children count function not working in case statement, I have tested it on my local environment, here s the sample query for you reference.
    with member
    testset as
    case
    when
    [Geography].[Geography].currentmember.children.count<10
    then "X"
    else "OK"
    end
    select testset on 0,
    {[Geography].[Geography].[Country].members} on 1
    from
    [Adventure Works]
    In your scenario, the issue might be caused by the query isself, you can try to use IsLeaf Funcion to achieve your requirement. Please refer to the links below.
    http://msdn.microsoft.com/en-us/library/ms144932.aspx
    http://www.databasejournal.com/features/mssql/article.php/3633696/MDX-Operators-The-IsLeaf-Operator--Conditional-Logic-within--Calculations.htm
    http://www.mdxpert.com/Functions/MDXFunction.aspx?f=22
    Regards,
    Charlie Liao
    TechNet Community Support

  • Palm Desktop 6.2.2. and Lookup function not working in Windows 7

    Palm Desktop's lookup function not working in Windows 7 64bit. Please help.
    Post relates to: Centro (Verizon)
    This question was solved.
    View Solution.

    I was able to solve this by unchecking compatibility mode and setting the application to run as administrative.

  • Send & Recieve functionality not working with  WebDav after installing Acrobat XI

    Send & Recieve functionality not working with  WebDav after installing Acrobat XI for PDF.  Acrobat XI is complete installations(Trial Version).

    Hi Kiro ,
    Did you try opening that file in any other browser ?If not ,please try doing that once and see if that  works for you.
    Try Repairing Acrobat once and see if  that helps.
    Launch Acrobat>Navigate to Help>Repair Acrobat Installation.
    Regards
    Sukrit Dhingra

  • Keyboard + mouse functions not working

    After updating InDesign CC 6-days ago started to have issue with all keyboard + mouse functions not working ex. shift key does not constrain proportions when scaling. A restart fixed the issue thr first time. Today I have installed latest update and shut down and restarted several times does not fix issue. On a MacBook pro running OS X Mavericks 10.9.2.

    Disconnected extrenal devices ie keyboard and Wacom Bamboo tablet and restarted computer seemed to correct the issue.

  • In my ipad zoom function not working..some day before it worked,but when i double pinch with my three fingers it zooms negligible, wat to do?plzz help me..

    In my ipad zoom function not working..some day before it worked,but when i double pinch with my three fingers it zooms negligible, wat to do?plzz help me..

    It works when I reset my all settings...
    Settings>general>reset>reset all settings
    It never delete ur all contacts and any others,but ur wallpaper and wifi connection will change..it can be as before...

  • HT204168 touch screen function not working when using facetime

    Why is my iPad touch screen function not working when using FaceTime?

    Hi megascones,
    I apologize, I'm a bit unclear on the exact nature or scope of the issue you are describing. If you are having issues with the touch screen on your iPad, you may find the troubleshooting steps outlined in the following article helpful:
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Regards,
    - Brenden

Maybe you are looking for