'addEventListener' not working in Javascript

Hi,
I am trying to explore the use of the 'addEventListener()' javascript event handler function. Below is the html/javascript code that I have written.
What I am trying to do is very simple... I am creating a form-input checkbox and display the alert "addEventListener Invoked !!" whenever the checkbox is clicked
The addeventlistener is supposed to monitor the checkbox for an 'onclick' event and display a alert pop-up whenever the checkbox is Clicked
What is happening is, when the html file with this code is opened in firefox or IE, the alert message is displayed immediately when the html page loads; and on clicking on the checkbox nothing happens :(
Now let me clarify, one might suggest to use the simple onclick=alert("xyz") event in the <input type="checkbox" id="check"/> tag....!! However, I want to implement this simple thing using addEventListener function...
So Gurus, it would be of great help if you can point out what is wrong with the below scrpit..
PS: I am a complete new bee in Javascript..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
    <title>test</title>
  </head>
  <body><form>
      <p>
        <input type="checkbox" id="check" />
      </p>
    </form><script type="text/javascript">
document.getElementById("check").addEventListener("onclick",alert("addEventListner Invoked !!"), false)
</script></body>
</html>

Hi,
From what I read on it, there are different methods depending on the browser you are using.
One other method that you could use is something similar to that which Apex itself uses for adding onload events:
&lt;script type="text/javascript"&gt;
the_checkbox_element.onclick = function() {alert("Hello");};
&lt;/script&gt;Andy

Similar Messages

  • Application.addEventListener not working as expected

    I wanted to add a global KEY_DOWN event listener and
    MOUSE_CLICK event listener to my app. The help files say to use the
    application.addEventListener(type, handler) to do this. I added the
    listeners in my creationComplete function but they do not work for
    windows I popup. I know these windows are in the application scope
    because I am setting application level model attributes in them
    that the main window uses. Why are these events not registering
    from popup windows if this is global?

    laurent demaret wrote:
    But I can also use application:openFile: that works too.
    No, you can't. The Apple Event "open files" will open one or more files. That is why the documentation says to use "application:openFiles:".
    And it is present as well in the application delegate protocol reference nearby application:openFiles: and application:openTempFile: all in the "Opening Files" tasks group.
    Why is one called in addition and not the other ? Is application:openTempFile: usage left to the reader guess?
    They are delegate messages. Their only reason for existence is for the programmer to use as he or she sees fit. In one specific example, the Apple event "open files", one of these delegate methods is the recommended way to handle the "open files" Apple Event.
    I did not found other answer in the Xcode documentation than the "How Cocoa Applications Handle Apple Events" paragraph of the Cocoa Scripting Guide OS (which is back to 10.4 as you noticed it) that advise to use application:openFiles: which brings me back to the other methods for opening files, some working, some not..
    I'm not used to such a fluzziness in the documentation.
    You are not used to the delegate pattern. This API has been in existence for 25 years across several, radically different, architectures. There is a lot of legacy there. If the documentation says to use method A and you discove that method B works too, you should switch to method A. There is no guarantee that method B will continue to work in the future. You have already discovered this as you keep trying to use techniques from 1991. Please, just use the recommended method. You have nothing to gain by trying other methods that have similar-sounding names and are described nearby to other methods in the documentation.

  • Suddenly can't enter anything in some blank search fields, dropdowns not working, and javascript popups freeze randomly. WTH?

    I noticed a few random things not working on my computer in the last month or so, and I tried everything I can think of to figure out what it is...still haven't figured it out yet. Some examples - I was on ebay, and the tracking number I clicked on from the "My ebay" page popped open a javascript window, but then froze the page so I had to close the whole tab. Then on Grooveshark, the main page comes up, but if I type anything in the search field, I can see what I'm typing, but at the same time, I can still see their default search message. If I try to enter something and hit search, it just gives me the warning that I'm being asked if I want to leave the page, it never searches. There are a few other times I can think of that I tried to use a dropdown menu, and they don't always work - they just look like they're being clicked, but nothing shows. Also not sure if this is related or not, but it bears mentioning - I tried to install Freecorder, and even though I tried both the toolbar and just the button for installation options, it doesn't show up for me to use it, and that's with adblock plus disabled. Also not positive my last update of Adobe Flash took, even though I downloaded it.
    I have adblock plus, but I've had that for years now, and it's never caused a problem or stopped me from seeing anything I actually wanted to see. My system was pretty bada** before this, and it's frustrating that suddenly I can't go everywhere and do everything I could before. Why is it doing this, and can I fix it??

    Meh...if I had started here instead of trying to research this randomly, I would have fixed the problem weeks ago. I just did a Firefox reset, and tried all the things I mentioned in the OP, and it all seems to work fine now. Well, aside from Freecorder, but I can make that work another way, I guess. Anyway, Firefox reset = solution. Yay!

  • Want to set mailto for google apps;tried editing the gecko...mailto.2.uritemplate as per instructions found on web; set 3 related config values to "true" as per instructions; does not work; tried javascript method without success

    I want to set the mailto app for google apps gmail.
    I tried editing the gecko...mailto.2.uritemplate as per instructions found on web (https://mail.google.com/a/MYDOMAIN/mail/?extsrc=mailto&url=%s.
    Set 3 related config values to "true" as per instructions (network.protocol-handler.expose.mailto ; network.protocol-handler.warn-external.mailto ; AND, third, gecko.handlerService.allowRegisterFromDifferentHost.
    Does not work, no Google Apps in the mailto app spot.
    Tried javascript method in address bar without success:
    javascript:window.navigator.registerProtocolHandler("mailto","https://mail.google.com/a/MYDOMAIN/mail/?extsrc=mailto&url=%s","Google Apps GMail")
    Any light anyone can shed will be appreciated. Cheers, jlf

    Great howto Steve! This further increased my understanding of the MVC patterns used by BC4J.
    Some remarks:
    [*]Select New Business Components...
    This should be 'New Business Components Package', or you won't be able to add business components.
    ename as "Name",
    sal as "Salary"
    from emp
    where empno = ?That should be deptno.
    [*]Select the EditEmpsInDepartment view objectThat should be EmpsInDepartment.
    Greetings,
    Ivo

  • Aperture help not working - getting JavaScript error message

    My Aperture 3 has been having a lot of strange issues lately, most, but not all of which have been cleared up by holding down command + option while starting up and going through all three of the choices there.
    One problem that remains is the inability to open the Help files. I keep getting the following message:
    “The Help Library requires JavaScript.
    If JavaScript is not enabled, you will not
    be able to view all the content.”
    Help works in all other applications, like Pages and Final Cut Pro. I don’t get JavaScript error messages in any other applications.
    I’ve already done an erase and restore from a Time Machine backup, and an archive and install. I reinstalled Aperture, although not by using the Terminal command suggested in the kbase article # HT3805.
    If I go the Terminal command route, will I lose all my projects, albums, and editing? What about Mobile Me galleries?
    I have a guest user on the computer, and when I log on to that user and open Aperture, the Help Library works fine. So, I know the problem is in my user account somewhere, but I don’t know how to address it. Any ideas?

    Welcome to the forums.
    The fact that you have access to java in another user suggests that it is a local setting or preference.
    In the applications folder/utilities there is an application Java Preferences, try resetting this and seeing if it works.
    If not, try deleting the java preferences file in your users folder
    systemHD/Users/user/Library/Preferences/com.apple.java.JavaPreferences.plist
    relaunch the app Java Preferences which creates a new preferences file for you, then try Aperture again.
    Let us know how this goes.
    Tony

  • Getfilebyserverrelativeurl not working in Javascript client object model

    Hi,
    I am using the "getfilebyserverrelativeurl" to verify if the file exists. But it does not seem to work.
    I am using Javascript client object model.
    Below is the code used:
    //ImageName = "test1.jpg" . This file does not exist in the below location
    var url = oweb.get_url() + "/Lists/LibraryName/folder1/" + ImageName;
    try {
    var fileUrl = oweb.get_serverRelativeUrl() + "/Lists/LibraryName/folder1/" + ImageName;
    oweb.getFileByServerRelativeUrl(fileUrl);
    window.location = url;
    catch (e) {
    alert("File does not exist.");
    I am not getting any errors in javascript, but the alert is not showing up.
    The file does not exist in the folder, so I am expecting the alert, but in-turn it redirects to "Page not found" OOB page.
    How to fix this?
    Thanks

    Hello,
    I see a few odd things with that code.
    Try it with the following changes and see if it makes a difference:
    // declared globally
    var fileName= "";
    var fileurl = "";
    function downloadImage(){
    fileName = "image1.zip";
    fileurl = SP.ClientContext.get_current().get_url() + "/LibraryName/foldername/" + fileName;
    var clientcontext = new SP.ClientContext.get_current()
    var oweb = clientcontext.get_web();
    var ofile = oweb.getFileByServerRelativeUrl(fileurl);
    clientcontext.load(ofile);
    clientcontext.executeQueryAsync(Function.createDelegate(this, this.RenderDownloadfilesOnSuccess), Function.createDelegate(this, this.RenderDownloadfilesOnFailure));
    function RenderDownloadfilesOnSuccess() {
    window.location = fileurl;
    function RenderDownloadfilesOnFailure(sender, args) {
    alert(fileName + " does not exist.");
    Which version of Internet Explorer are you using for debugging? The F12 developer tools will allow you to debug JavaScript and "step out" of executing JavaScript code so you can trace the problem back to where it originates in your own code
    instead of debugging the resulting errors that crop up in the built-in stuff (like MicrosoftAjax.js)

  • Firefox 4 not working with Javascript. Cannot close window. Any ideas?

    I first noticed the problem in my web site, but now in other sites. When I open a window and try to press the button to close it, it doesn't work. Code is: javascript:window.close();
    It worked in previous version of Firefox but not since I loaded 4.0. I tried it in Explorer and it works fine.

    Hi, I've noticed the same issue . But for me this happens if I use Print Preview first. JavaScript works just fine before using Print Preview. But the most interesting thing is that when using javascript:window.close(); after Print Preview all that happens is that the character set of the page changes. On the other hand the character set works properly only after Print Preview. Interesting...

  • InDesign CC addEventListener not work

    Don't work in InDesignCC addEventListener:
    var w =new Window ("dialog");
    var b = w.add ("listbox", undefined, "Qwerty");
    b.addEventListener("click", function (k){
        alert("detail: "+k.detail+'\r'+"X: "+ k.clientX+'\r'+"Y: "+ k.clientY);
    w.show ();
    it's ok to work in ESTK and CS.

    XH.XH wrote:
      Yes, left click have no reaction, right click the is there will be a left click.
    Hi XH.XH
    It's not that the right click is "acting" as a left click rather all clicks (left, middle, right, or any other mouse button click if the mouse has them) are clicks, each button has a numeric value to it which can be retrieved on being clicked.
    The problem is cause by CC improved focus that's why it works on CS.
    For a solution you can fake most things, enjoy.
    // Fake List box  http://forums.adobe.com/message/5955686
    // by Trevor www.creative-scripts.com (coming soonish)
    // Note one has to pay attention to bubbling
    var w = new Window ('dialog', "Fake Item List Demo :-)"),
          myAdd = w.add('statictext', undefined, "Fake itemList, Made by Trevor, available for custom scripts, www.creative-scripts.com (soonish)"),
          clickMe =  w.add('statictext', undefined, "Click an Item"),
          fakeListBox = w.add('panel'), // sometimes better to use group
          p = w.add('panel'),
          myListItemStrings = ["List Item 1", "List Item 2", "List Item 3", "List Item 4", "List Item 5", "List Item 6"],
          myListItems = [],
          l = myListItemStrings.length,
          n, info1, info2, info3, infoBox,
          green = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[0,1,0], 1),
          red = w.graphics.newPen(w.graphics.PenType.SOLID_COLOR,[1,0,0], 1);
    myAdd.graphics.foregroundColor = green;
    for (n = 0; n < l; n++)
          myListItems[n] = fakeListBox.add('statictext', undefined, myListItemStrings[n]);
          myListItems[n].preferredSize.height = 18;
          myListItems[n].graphics.foregroundColor = red
    info1 = p.add('statictext');
    info2 = p.add('statictext');
    info3 = p.add('statictext');
    info4 = p.add('statictext');
    infoBox = p. add('edittext', undefined, undefined, {multiline: true});
    infoBox.preferredSize = [950, 200]
    info1.alignment = info2.alignment = info3.alignment = info4.alignment = 'fill';
    fakeListBox.orientation = 'column';
    fakeListBox.spacing = 0;
    fakeListBox.margins = [5,1,5,1];
    for (n = 0; n < l; n++)
        myListItems[n].addEventListener ('click', function (k){
        info1.text = (k.view.text + " was " + ((k.detail == 2) ? "double clicked " : "single clicked ") + " with mouse button: " + k.button);
        info2.text = "Clicked X: "+ (k.clientX + k.view.location[0])
                      +  " Y: "+ (k.clientY + k.view.location[1])
                      + " possitons are in relation to the panel";
        infoBox.text = "";
        for (pr in k ) infoBox.text += (pr+ ": " + k[pr] + "\t"
                                        + ((Object(k[pr]).constructor.toString ().match (/Object/i)) ? Object(k[pr]).toSource().replace(/\,/g, ", ").replace(/:/g, ": ") : "")
                                        + "\r");
        colorListItem (k.view);
    fakeListBox.addEventListener ('mouseover', function (k){
        info3.text = "Current pointer position: X: " + k.clientX + " Y: " + k.clientY + " Hey did you notice that the possitons are normaly in relation to the list item and not the panel! (Bubbling!) :-("
        info4.text = "Current pointer position: X: " + (k.clientX + k.view.location[0]) + " Y: " + (k.clientY + k.view.location[1]) + " That's better :-)"
    fakeListBox.addEventListener ('mouseout', function (k){
        info3.text = info4.text = "";
    function colorListItem (item, items, group, x, l) {
        group = item.parent;
        items = group.children;
        l = items.length;
        while (l--) items[l].graphics.foregroundColor = (items[l] == item) ? green : red;
    w.show ();

  • HTML5 code hinting not working inside Javascript Function on DW CS6

    Hi,
    I am working on Dreamweaver CS6 and code hinting isnt working as expected when writing Javascript code.
    The minute I insert a function the code hinting doesnt display HTML5 items anymore.
    Should I remove the function then the HTML5 hinting reappears.
    How do I get the code hinting to work when I add in the function?
    Thanks
    Herman

    Herman Kramer wrote:
    Thanks for this. Please keep me posted if this is a bug or not.
    For now it does look like a bug. Let's wait for someone from Product team to revert.

  • ViewStack addEventListener not working

    Hi,
    My code adds a hanler via an eventListener to a ViewStack component at Initialization, but when I run my application and change the view, the handler never gets triggered.
    Code :
    myViewStack.addEventListener(IndexChangedEvent.CHILD_INDEX_CHANGE, ViewHandler);
    However if I add the Handler inside the <ViewStack> tag it works.
    Any idea about what the problem could be?
    thanks
    -Malena

    Okay, I found the problem myself. Looks like the type of event shoud be IndexChangedEvent.CHANGE and not IndexChangedEvent.CHILD_INDEX_CHANGE, so that is why the handler was never triggered.

  • Callback mechanism is not working in Javascript

    JDK versions: Problem occurs in JRE1.4.2 and JRE1.5 (JRE142_05, 5.0 beta), but NOT JRE1.3.1.
    OS: WIndows
    Here is the problem Scenario
    1. A Webpage ( GOM - Javascript ) is running
    2. Clicking on a button in the above webpage will load an applet ( enc3 )
    3. Once we are done with the applet, click on return button to go back to GOM
    4. To return to GOM, function performMiniflowReturnWithMessage in the java file is called which in turn calls "this.getAppletContext().showDocument(new URL(miniFlowClosePage.toString()),"_top");".
    Subsequently function closeMiniflowWindow() is called in the HTML page which in turn calls sendREsultsToGOM.
    Here the call to ""opener."+returnStatusMethodName+"(status, msg, data);";" is throwing a javascript error in Sun plugin.
    Exact text of error message:
    The exact error message is ( JavaScript Error: http://nc3ft3a.ugd.att.com/enc3home/closeminiflowapplet.html??Callback=NC3_alertOnError&Status=-1&Msg=Neither E2EPVC_ODBIDS or ROUTER_ODBID Params was not sent to VPN applet.&, line 44: opener.NC3_alertOnError is not a function )
    Here are our findings :
    1. I could notice that "getAppletContext().showDocument" is one java api that customer is using and this is being called before application encounters problem reported that is the javascript error
    2. showDocument API's functionality is that it requests that the browser or applet viewer show the Web page indicated by the url argument. This API has 2 parameters one is URL and other is the TARGET.
    Target can be any one these
    a. "_self" show in the current frame
    b. "_parent"show in the parent frame
    c. "_top" show in the topmost frame
    d. "_blank" show in a new unnamed top-level windownameshow in a new top-level window named name
    3. In the customer's application, for this API showdocument, URL argument passed is "enc3home/closeminiflowapplet.html?" and _top is passed as Target argument. Hence, the expected behaviour is that topmost frame of this URL that is GOM should be shown instead the above javascript error is thrown. The probable cause could be that instead of getting the link to GOM ( topmost window of enc3 ),  application is getting link to enc3 itself.
    4. Actually this.getAppletContext() as used in the application along with showDocument sun.plugin.viewer.context.NetscapeAppletContext. Therefore NetscapeAppletContext.showDocument is called within the application.
    5. NetscapeAppletContext extends DefaultPluginAppletContext and the showDocument method of this class is called. This function inturn calls doShowDocument. I suspect these functions and this needs to be investigated.
    Also please note that the classes NetscapeAppletContext and DefaultPluginAppletContext are not there in 131 and customer says that problem is not there in 131. Also, the this.getAppletContext will return sun.plugin.navig.win32.AppletPluginContext.
    Application source code is available.

    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)

  • .click on row works with php table - does not work with javascript table.

    Howdy,
    I've run into a very interesting problem today, and I hope you'll be able to help me.
    I have a page in which the top is php to read a table from the server, and post the table as the html page is being built.
    The data come up as a table, and each row is clickable, that click moving the user to a different page, based on the row clicked.
    Here are the relevant parts of the php code:
    <?php
    echo "<table id='patienttable' cellpadding=5px border=0 font-size=16px>";
    echo "<tr><th width='30'>"."ID#"."</th><th width='100'>"."Last Name"."</th><th width='100'>"."First Name"."</th><th width='100'>".
    "Middle Name"."</th><th width='80'>"."DOB"."</th><th width='50'>"."Zip"."</th><th width='50'>"."Gender"."</th><th width='100'>".
    "Phone"."</th></tr>";
    while ($row = mysqli_fetch_array($result))
    blah blah blah
    echo "<tr><td id='localid'>".$localid. "</td><td>".$lastname. "</td><td>".$firstname. "</td><td>".$middlename."</td><td>".$dob."</td><td>".$physzip. "</td><td>".$gender."</td><td>".$phone1.       "</td></tr>";
      echo "</table>";
    ?>
    And here is the code to click on a row:
    $("#patienttable tr").click(function() {
           var passthis = $(this).find("#localid").html();
           $.post("php/setsessionvariable.php",
                  {sessionval: passthis},
         function(e) {window.location.href = "root.php"}
    EVERYTHING works great - no problems - working now for about 2 months.
    Today I started to build something similar, BUT! I cannot read from the database at the top of the page, I must do an ajax query, call the db, and post the data in a table;
    Here is the boring, fairly straight-forward javascript code:
    $.ajax({
        type: "POST",
        url: "findpatientbackend.php",
        data: {letterslastname: lastname},
        dataType : 'json',
        success: function(result) {
      $("#div1").html("");
            if(result.length >= 1)
       {var output = "";
             $("div1").html("<table id='findtable'>");
              $.each(result, function(index, value) {
                                                     output += "<tr><td width='100px'></td><td id='localid' width='100px'>"
                 + value.localid + "</td><td width='100px'>"
                 + value.lastname + "</td><td width='100px'>"
                 + value.firstname + "</td><td width='100px'>"
                 + value.middlename + "</td><td width='100px'>"
                 + value.dob + "</td></tr>";
                $("#div1").html(output);
             $("div1").html("</table>");  
        error : function() { alert("error on return"); }
    And here is the click row code, almost EXACTLY like the one above:
    $("#findtable tr").click(function() {
           var passthis = $(this).find("#localid").html();
           $.post("php/setsessionvariable.php",
                  {sessionval: passthis},
         function(e) {window.location.href = '../root.php'}
    All the "stuff" loaded onto the page just fine, BUT, absolutely nothing happens when I click a row.
    Playing around this afternoon, I did a "View Source" on both pages, and saw something VERY interesting;
    1 - The table written by PHP is present, can be seen, and therefore is "clickable" to the jquery .click function.
    2 - The table written by javascript is INVISIBLE! I cannot see it in the source view (but I can see it on the screen) and therefore the .click function can't see it either.
    Questions:
    1. How can I make the table written in javascript "clickable" - how can I make the javascript table "visible"?
    2. Could it be the use of ".html" to post the table to the div? Is there another way?
    And again, I thank you in advance for any help.

    I found the solution to my problem, and perhaps my comments here will help others.
    Thinking a bit more, I wrote a separate javascript routine that created a table, allowed it to be styled, and allowed it to be clickable.
    Here is the code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html>
    <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js" type="text/javascript"></script>
    <style>
    #findtable {
    width:200px;
    background-color:#CFD3FE;
    margin:10px auto;
    text-align:center;}
    </style>
    <body>
    <div id="puttablehere"></div>
    <script>
    $(document).ready(function () {
    var output = "<table id='findtable'>";
    for (var i = 0; i<15; i++) {output += "<tr><td width='100px'>X</td><td id='localid' width='100px'>X</td></tr>";}
    output += "</table>";
    $("#puttablehere").html(output);
    $("#findtable tr").click(function(e) { alert("it works!"); });
    </script>
    </body>
    </html>
    The initial code I posted was creating the table the wrong way.
    You have to create the WHOLE table at the same time, and post it all at once.
    The code above does that.
    My learning points are:
    1. To create a table in javascript, and post it with a $("#puttablehere").html(output); call, you must put the ENTIRE table into that single string variable called "output" (or whatever you want to call it).
    2. Everytime you call a jqeury .html function like this: ---("#puttablehere").html(output); -- It COMPLETELY over-writes the whole div/tr/td block that it is pointed at.
    3. If you create a table in javascript (client side) you cannot see it with "View Source" - because what is posted in the table is AFTER the DOM is loaded.
    Creating a table with php server side - you CAN see, because it is posted with the DOM.
    So I thank you for your ideas, and I hope this may help another noob, such as myself, in the future.
    Adios!

  • Muiltiple forms + addEventListener not working

    Any know of any issues with defining eventListeners to fields
    across forms on the same mxml doc? See my code below, the first
    event handler gets set fine, but any secondary ones do not get set.
    No compilation errors here?
    <mx:Box
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="100%"
    height="100%" paddingTop="5" paddingLeft="5"
    creationComplete="init()">
    <mx:Script>
    <![CDATA[
    private function init():void{
    //This first event listener gets set but the second one does
    not...
    Email.addEventListener(FocusEvent.KEY_FOCUS_CHANGE,
    tabAccordian);
    permCountry.addEventListener(FocusEvent.KEY_FOCUS_CHANGE,
    tabAccordian);
    Alert.show(Email.tabIndex.toString());
    private function tabAccordian(fEvent:FocusEvent):void{
    //Alert.show(fEvent.currentTarget.toString());
    formAccordion.selectedIndex += 1;
    ]]>
    </mx:Script>
    <mx:Accordion id="formAccordion" width="100%"
    height="510">
    <mx:Form id="applicantData" label="Personal Information
    (1-6)" creationComplete="init()" >
    <mx:FormItem label="Last Name">
    <mx:TextInput id="lastName" tabIndex="1"/>
    </mx:FormItem>
    <mx:FormItem label="First Name">
    <mx:TextInput id="firstName" tabIndex="1"/>
    </mx:FormItem>
    <mx:FormItem label="Email">
    <mx:TextInput id="Email" tabIndex="2"/>
    </mx:FormItem>
    </mx:Form>
    <mx:Form id="permAddress" label="Permanent Address (7)"
    creationComplete="init2()">
    <mx:FormItem label="House or Building #">
    <mx:TextInput id="permHouseNum" width="60"
    tabIndex="10"/>
    </mx:FormItem>
    <mx:FormItem label="Country">
    <mx:TextInput id="tempCountry"/>
    </mx:FormItem>
    </mx:Form>
    </mx:Accordion>

    Hi,
    I modified your code to the following. Both the event
    listeners are getting registered.
    Hope this helps.
    private function init():void{
    //This first event listener gets set but the second one does
    not...
    Email.addEventListener(FocusEvent.KEY_FOCUS_CHANGE,
    tabAccordian);
    private function init2():void{
    //This first event listener gets set but the second one does
    not...
    permCountry.addEventListener(FocusEvent.KEY_FOCUS_CHANGE,
    tabAccordian);
    private function tabAccordian(fEvent:FocusEvent):void{
    //Alert.show(fEvent.currentTarget.toString());
    formAccordion.selectedIndex += 1;
    ]]>
    </mx:Script>
    <mx:Accordion id="formAccordion" width="100%"
    height="510">
    <mx:Form id="applicantData" label="Personal Information
    (1-6)" creationComplete="init()" >
    <mx:FormItem label="Last Name">
    <mx:TextInput id="lastName" tabIndex="1"/>
    </mx:FormItem>
    <mx:FormItem label="First Name">
    <mx:TextInput id="firstName" tabIndex="1"/>
    </mx:FormItem>
    <mx:FormItem label="Email">
    <mx:TextInput id="Email" tabIndex="2"/>
    </mx:FormItem>
    </mx:Form>
    <mx:Form id="permAddress" label="Permanent Address (7)"
    creationComplete="init2()">
    <mx:FormItem label="House or Building #">
    <mx:TextInput id="permHouseNum" width="60"
    tabIndex="10"/>
    </mx:FormItem>
    <mx:FormItem label="Country">
    <mx:TextInput id="permCountry"/>
    </mx:FormItem>
    </mx:Form>
    </mx:Accordion>

  • Submit button is not working

    I have created a fillable web form using the FormsCentral app on my mac.
    It has a couple of required fields, and a couple of show/hide fields.
    It tests perfectly, and we sent out a link to the formscentral link to all staff and for some people it does not work. They can see the form and fill in data, but the show/hide stuff doesn't perform correctly and the submit button doesn't work.
    Works for me in Safari and Firefox, and seems sketchy in IE - works for some but not others.
    Any thoughts?

    The first thing to confirm is that the form is an HTML/web form and not a PDF embedded in the browser, if it is a PDF please see this FAQ: http://forums.adobe.com/docs/DOC-4142
    Assuming you or your customers/users are having problems submitting the HTML/web form - the most common cause of show/hide logic not working and the Submit button not working is Javascript is not enabled in the web browser.
    Some things to try (since instructions for each item vary per browser google the steps for the browser you are using):
    Confirm that Javascript is enabled (required for FormsCentral forms):
    http://www.javatester.org/javascript.html
    Clear the browser cache
    Try disabling browser plugins
    If using Internet Explorer check to see if the page is in "Compatibility View" mode and if so try turning it off
    Try a different web browser
    I know that this is made more difficult by the fact that it is not you reporting this issue but your customers and you may not have acess to try the steps above...
    If these steps don't resolve the issue please respond with the operating system you are on (Mac or Windows) and which web browser and version you are using.
    You can send me the URL to your form at [email protected] so I can try in IE on Windows to confirm that in general it works (or identify an issue if it does not).
    Thanks,
    Josh

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

Maybe you are looking for

  • :NEW cannot be used in After Delete Trigger ?

    Hi, Is there any way to get the :NW.value in the After delete trigger for each row. My requirement is audit log of the end user DML operations along with user Name (HERE THE USER IS NOT THE ORACLE USER, BECAUSE OF THE LARGE NUMBER OF END USERS WE ARE

  • 32 Bit HDR Problem With Lightroom and Photoshop CS6

    Hello all: In following Julieanne's Adobe TV topic here ->  http://tv.adobe.com/watch/the-complete-picture-with-julieanne-kost/quick-tip-creating-32bi t-hdr-images-in-lr-41/ a problem arises when trying to save from Photoshop CS 6. According to Julie

  • Word 2010 freezes when opening a file from a share drive

    Issue:  In our office, one user who is opening up a document from a share folder will experience Microsoft word freezing.  It doesn't display a not responding message It doesn't lock up and close out automatically It doesn't show any behavior typical

  • Can I have differnet passwords for itunes and icloud

    Can I have different passworkds for itunes and icloud

  • ESS Create Expense Report

    Hi We have ECC6 and EP7 we are using the create expense report iview in ESS. We have an issue whereby if a  user creates an expense report and after saving uses the 'what do you want to do next' link 'Go To Travel Home Page' and is taken to the Trave