Why this javascript can't run?

Hi,i have a page like this,but the javascript function can't run,please help!
<?xml version="1.0" encoding="UTF-8"?>
<jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
        <ui:page binding="#{StandardTags$javascript.page1}" id="page1">
            <ui:html binding="#{StandardTags$javascript.html1}" id="html1">
                <ui:head binding="#{StandardTags$javascript.head1}" id="head1">
                    <ui:link binding="#{StandardTags$javascript.link1}" id="link1" url="/resources/stylesheet.css"/>
                    <script type="text/javascript">
                       function checkPassword(form)
                           var password=form["passwordForm:password"].value;
                           var confirmPasword=form["passwordForm:confirmPassword"].value;
                           if(password==confirmPassword)
                              alert("Password Matched");
                           else  alert("Password Not Match");
                    </script>
                </ui:head>
                <ui:body binding="#{StandardTags$javascript.body1}" id="body1" style="-rave-layout: grid">
                    <ui:form binding="#{StandardTags$javascript.passwordForm}" id="passwordForm">
                        <h:outputText binding="#{StandardTags$javascript.outputText1}" id="outputText1" style="left: 264px; top: 48px; position: absolute" value="Input Password"/>
                        <h:inputSecret binding="#{StandardTags$javascript.password}" id="password" style="left: 264px; top: 96px; position: absolute"/>
                        <h:inputSecret binding="#{StandardTags$javascript.confirmPassword}" id="confirmPassword" style="left: 264px; top: 144px; position: absolute"/>
                        <h:commandButton binding="#{StandardTags$javascript.button1}" id="button1" onclick="checkPassword(this.form)"
                            style="left: 264px; top: 192px; position: absolute" value="Submit"/>
                    </ui:form>
                </ui:body>
            </ui:html>
        </ui:page>
    </f:view>
</jsp:root>

By the way,the <h:commandButton ....> part needs modifying, we need to set its "type" attribute value explicitly to "button" to invoke the javascript function.
thanks:)

Similar Messages

  • How can you expect the customer to have a LOCAL/COUNTRY Based Credit Card every where we go??? Last week I was on holiday in HK,  and  from my Hotel I was able to use m VN Credit Card with my Apple ID and purchase online!  Why THIS WEEK, can't I use my HS

    Apple_ID_card_declined_for_this_country
    How can you expect the customer to have a LOCAL/COUNTRY Based Credit Card every where we go???
    Last week I was on holiday in HK,
    and
    from my Hotel I was able to use m VN Credit Card with my Apple ID and purchase online!
    Why THIS WEEK, can't I use my HSBC Platinum Credit Card from Vietnam,
    for my Singapore Apple ID account ,
    while working here in Vietnam???

    Unfortunately, this is a problem that is driven by the DRM Dictatorship.  Despite the proliferation of mobile devices and the fact that there are many of us who do a lot of international travel, content providers don't want you to have access to their products outside of your homeland.  The Balkanized mentality of the DRM Dictatorship is way out of touch with the modern world.
    At least Apple, to its credit, allows you to use your accounts outside of your homeland as long as you have the proper credentials for them.  Most other services use the more Draconian geolocation filtering which does require you to be physically present in your homeland.  For the most part, you are not allowed to leave home if you want access to your favorite entertainment!

  • I have an Intel iMac running OSX 10.6.8. I would like to use Final Cut Pro 10.1. I know I need OSX 10.9 for this. Can I run both 10.6.8 and 10.9 on the iMac ? I do not want to convert completely to 10.9 because of my existing software. Thanks for any help

    I have an Intel iMac running OSX 10.6.8. I would like to use Final Cut Pro 10.1. I know I need OSX 10.9 for this. Can I run both 10.6.8 and 10.9 on the iMac ? I do not want to convert completely to 10.9 because of my existing software. Thanks for any help

    It would depend on how old your IMac is, how mush memory you have, it it can be upgraded by OWC, etc. I have a 2006 Macbook Pro and would NOT put Mavericks on it or espeacially FCP 10.1.1 on it because the most memory it can have is 4 GB. You need at least 8 GB to work with Final Cut Pro 10.1.1. IMHO.
      I would try to find a copy of Final Cut Express perhaps.
      Does this answer your question?

  • Setup.exe "This app can't run on your PC"

    Hello, I've been trying to install Windows 8 on my macbook pro (mid 2012) using boot camp. I was using a windows 8 .iso file with a flash drive. I got Windows 8 installed and running, but when I tried to install the boot camp drivers off of the flash drive (setup.exe) I keep getting a fullscreen error message saying "This app can't run on your PC. To find a version for your PC, check with the software publisher." I've tried redownloading the windows support drivers to the flash drive but it didn't work. I'm having trouble finding any instance of this on all of the forums I checked and it is geting very frustrating. If anyone can help with this it would be much appreciated.

    I think I found the problem, I discovered that I had installed a 32 bit windows 8 instead of the 64 bit one. Based on some other threads I've seen I'm guessing this is the problem and will post again when I'm finished reinstalling the 64 bit version in case anyone is curious.

  • Can't run NMCAP on Server 2012 R2 - "This app can't run on your PC"

    Hi all,
    For some reason it would appear Microsoft have blocked NMCAP running on Windows 2012 R2 and 8.1 in the last week or so.
    When running NMCAP at the command line I get "This app can't run on your PC"
    Does anyone know how to get around this?
    Thanks,
    Daniel

    Hi Paul,
    It seems to work on my Windows 8.1 machines as well, but nmcap won't won't run on any of our Server 2012 R2 machines now, it just gets blocked by SmartScreen.  I can run Network Monitor ok.
    It means I can't do things like this: nmcap.exe /network * /capture /file C:\nmcap\%computername%.chn:150M /TerminateWhen /KeyPress x
    Very odd!

  • I Have a silver w/Mirror doors dual 867 running OSX10.2. I try to install OS9.2.1 I get "THIS PROGRAM CAN NOT RUN ON YOUR COMPUTER" Message I need to be able to run Classic.

    I have a powermac Silver with mirror doors 867 dual processors running OSX 10.2 no problem there but I need to run Classic but when I try to install OS 9.2.1 I get a "THIS PROGRAM CAN NOT RUN ON YOUR COMPUTER" message.

    Your G4 (MDD) dual 867MHz model Mac requires the model-specific version of OS 9.2.2 which originally came with that machine. It can not use any other version of OS 9.
    The model-specific version of OS 9.2.2 can be installed using the original disk set which came with that machine; that disk set boots to OS X 10.2, but the installer on it can install OS 9.2.2 (Classic) as an option.
    There is no stand-alone install disk (such as a retail, i.e. white-label, CD) which can be used to install Classic on that model G4.

  • SetDpmServer.exe (4.1.3465.0) on Windows Server 2012R2 (Azure VM) This app can't run on your PC: Access denied

    Hi,
    I've installed on a Windows Server 2012 R2 (Azure VM) the DPM agent 4.1.3465.0. This VM is not a domain member of my DPM 2012 SP1. So I ran the command
    SetDpmServer.exe -dpmServerName dpm.domain.com -isNonDomainServer -userName dpm -productionServerDnsSuffix
    domain.com
    Although I'm running the command prompt as Administrator I receive:
    This app can't run on your PC
    And in the command prompt I see: Access denied
    How can I tackle this?
    Thanks,
    John
    John

    Hi John,
    Here are 2 things I would like to confirm.
    1. Please confirm if Protection Agents is installed on target computer before running the command line. 
    In following article it provides the command line which you are using now. However it mentioned to install Protection Agents manually on target server first:
    Installing Protection Agents on Computers in a Workgroup or Untrusted Domain
    http://technet.microsoft.com/en-us/library/ff399479.aspx
    And please noticed the 2 community additions:
    1.  make double-click on DPMAgentInstaller_x64.exe without specify DPM server name
    2. follow the examples in this article:
    http://technet.microsoft.com/en-us/library/ff634193.aspx
    1). Enable NETBIOS over TCP/IP on BOTH DPM Server and proposed managed machine's WINS tab of NIC card properties sheet Local area connection status -----> Properties -----> Internet Protocol Version 4 -------> Properties ----> Advanced ----->
    WINS tab. Also assumes disable Windows Firewall OR create needed port openings.
    2). When using SetDpmServer.exe command also CRITICAL to use ONLY NETBIOS name of DPM Server and do NOT include [-productionServerDnsSuffix <DnsSuffix>] end command at username.
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Any idea why this javascript always brings the console up?

    I'm not a great java expert but for some reason the code below always brings the console up before it executes correctly.
    Any help or suggestions would be appreciated.
    Thanks
    Steve
    // Set Doc Info
    // Save existing settings
    var temp = this.info.title;
    //Show dialog box
    var cRtn = app.response("Current Doc Summary is: \"" + temp + "\"");
    //Check for empty response
    if ((cRtn == null) || (cRtn == ""))
    this.info.title = temp;
    else
    this.info.title = cRtn;
    //Set author
    this.info.author = "Steve";
    //Set Subject if empty
    if (this.info.subject == "")
    this.info.subject = "Steve Subject"

    I just did the same test and pasted the code into a button on a blank form and it executed properly without opening the console too!!
    Why it feels the need to open the console when run from a batch sequence beats me, thought it might have been one of the settings to display errors etc but even when they are all de-activated up pops the console each time.
    A simple one liner does not open the console so I thought maybe it was a code error that I was missing.
    Doh!

  • Why my program can only run once?

    I have a program that is already run for a long period. The program will move a axis backward to find index to
    set the zero position. But in these day, i don't know why it cannot find the index and the motor will be out of
    control. After i used a new motor control card to replace the old one, i can run the peogram once. But when
    i use the program again, it will have the same problem. I need to shutdown the computer first to run it again.

    Hi,
    There are a few things that could be causing the problem.  To help narrow the problem down try running
    the program and then go into MAX under 1D interactive (Device and
    Interfaces>>NI Motion Devices>>PCI
    XXXX>>Interactive>>1D Interactive) to see if you are getting an
    error there.   Run the code in highlight execution, and then watch
    MAX to see where the error occurs.  Let
    us know what axis status lights go on/off and when it happens.  
    Also if you could send a reduced sample of your code (one
    main VI that contains just enough sub vi’s to move the motor and then read it’s
    position) that still reproduces the same error then it would be easier to test
    here.  Let me know what you find out when
    you run the code in highlight execution.
    Have a great day,
    GG

  • Why this tree can not show on the Applet?

    hi, all, I try to create a java Applet show a tree, this following code has no error, but the tree can not show on the Applet, can any one tell me why? thanks!
    <code>
    import java.awt.*;
    import java.applet.Applet;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.dnd.*;
    public class AppletApp extends Applet {
         Date myDate;
         protected JTree m_tree = null;
         protected DefaultTreeModel m_model = null;
         protected JTextField m_display;
         public void init() {
         public void paint(Graphics g) {
              DefaultMutableTreeNode root = new DefaultMutableTreeNode("root");          
              DefaultMutableTreeNode node1 = new DefaultMutableTreeNode("node1");          
              root.add(node1);                    
              node1.add(new DefaultMutableTreeNode("sub1_1"));                         
              node1.add(new DefaultMutableTreeNode("sub1_2"));                                        
         public static void main(String arg[]) {
              JFrame myFrame = new JFrame();          
              Container contentPane = myFrame.getContentPane();
              contentPane.setLayout(new GridLayout(1,2));          
              AppletApp app = new AppletApp();          
              contentPane.add(new JScrollPane(app), BorderLayout.CENTER);     
              myFrame.addWindowListener (new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(0);
              app.init();
              app.start();
              myFrame.setSize (400,400);                              
              myFrame.setVisible(true);          
    </code>

    Not quite sure what you are trying to do, but if you move the code from the paint() method into the init() method (then delete your paint() method), then add one new line to the init() method (after the code you just inserted) that reads:
    getContentPane().add(new JTree(root));
    - You should at least see a tree!

  • Can anyone help to check if this seq can open/run in teststand2013 32bit?

    this seq was created by V2014 32bit and saved as V2013(5.1X) format.
    but it can't be opend in another computer with teststand 2013 32bit and shows error: "your file (saved with TS 2014) is incompatible with our version of Teststand (2013)"
    I have to know if it caused by PC.
    thanks!
    Solved!
    Go to Solution.
    Attachments:
    L281A1303_4213_001.seq ‏29 KB

    I have no problems opening it with TestStand 2013, see attached screenshot.
    Attachments:
    screenshot.png ‏244 KB

  • My Asus Ultrabook says of the download of Premiere Elements 10 "This app can't run on your PC" and will not open installer (although I PSE10 working)

    I am running Win 8.1.  I have no DVD drive, so i downloaded. 
    Originally, the download #1 of 2 has an extension of ".7z".  I changed this to ".exe" .

    change it back to .7z.
    then download the accompanying file 2 of 2 (the exe), put both the 7z and exe in the same directory and click (or double click) the exe.

  • Why this program can not update the datatbase?

    The database I used is MS SQL Server 2000.
    The program can run normally,but the table is not updated.
    import java.sql.*;
    public class BatchUpdate {
    public static void main(String args[]) {
    String url = "jdbc:mySubprotocol:myDataSource";
    Connection con;
    Statement stmt;
    try {
    Class.forName("myDriver.ClassName");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException: ");
    System.err.println(e.getMessage());
    try {
    con = DriverManager.getConnection(url, "myLogin", "myPassword");
    stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
    ResultSet.CONCUR_UPDATABLE);
    con.setAutoCommit(false);
    stmt.addBatch("INSERT INTO COFFEES " + "VALUES('Amaretto', 49, 9.99, 0, 0)");
    stmt.addBatch("INSERT INTO COFFEES " + "VALUES('Hazelnut', 49, 9.99, 0, 0)");
    stmt.addBatch("INSERT INTO COFFEES " + "VALUES('Amaretto_decaf', 49, 10.99, 0, 0)");
    stmt.addBatch("INSERT INTO COFFEES " + "VALUES('Hazelnut_decaf', 49, 10.99, 0, 0)");
    int [] updateCounts = stmt.executeBatch();
    ResultSet uprs = stmt.executeQuery("SELECT * FROM COFFEES");
    System.out.println("Table COFFEES after insertion:");
    while (uprs.next()) {
    String name = uprs.getString("COF_NAME");
    int id = uprs.getInt("SUP_ID");
    float price = uprs.getFloat("PRICE");
    int sales = uprs.getInt("SALES");
    int total = uprs.getInt("TOTAL");
    System.out.print(name + " " + id + " " + price);
    System.out.println(" " + sales + " " + total);
    uprs.close();
    stmt.close();
    con.close();
    } catch(BatchUpdateException b) {
    System.err.println("SQLException: " + b.getMessage());
    System.err.println("SQLState: " + b.getSQLState());
    System.err.println("Message: " + b.getMessage());
    System.err.println("Vendor: " + b.getErrorCode());
    System.err.print("Update counts: ");
    int [] updateCounts = b.getUpdateCounts();
    for (int i = 0; i < updateCounts.length; i++) {
    System.err.print(updateCounts[i] + " ");
    } catch(SQLException ex) {
    System.err.println("SQLException: " + ex.getMessage());
    System.err.println("SQLState: " + ex.getSQLState());
    System.err.println("Message: " + ex.getMessage());
    System.err.println("Vendor: " + ex.getErrorCode());

    con.setAutoCommit(false);The changes are not comitted to the DB when you set autocommit to false.
    commit with
    con.commit();
    or dont set autocommit to false
    rgds

  • I tried to upgrade my Acer W3-810 tonight and got message saying "This PC can't run Windows 10".

    It says the Intel Graphics Media Accelerator isn't compatible with Wiundows 10.  does anyone know what I can do about this?

     same problem , check here  http://community.acer.com/t5/Windows-10/Iconia-W510-not-compatible-with-Windows-10/m-p/372523#U372523 

  • Why this javascript doesn't work on IE 6

    Hi all
    I keep clicking on the button but nothing seems to happen. I'm using IE6 and I have also started tomcat . Pls advise.
    Here is my code
    <HTML>
         <HEAD>
              <TITLE> USING BUTTON </TITLE>
         </HEAD>
         <BODY>
              <%
                   if(request.getParameter("b")!=null){
              %>
              You clicked
              <%= request.getParameter("b")%>
              <%
              %>
              <FORM NAME="form1" METHOD="POST">
                   <INPUT TYPE="HIDDEN" NAME="b">
                   <INPUT TYPE="BUTTON" VALUE="BUTTON 1" onclick()="button1()">
                   <INPUT TYPE="BUTTON" VALUE="BUTTON 2" onclick()="button2()">
                   <INPUT TYPE="BUTTON" VALUE="BUTTON 3" onclick()="button3()">
              </FORM>
              <SCRIPT>
                   <!--
                        function button1()
                             document.form1.b.value="button 1"
                             form1.submit()
                        function button2()
                             document.form1.b.value="button 2"
                             form1.submit()
                        function button3()
                             document.form1.b.value="button 3"
                             form1.submit()
                   // -->
              </SCRIPT>
         </BODY>
    </HTML>

    Hi all
    I keep clicking on the button but nothing seems to
    happen. I'm using IE6 and I have also started tomcat
    . Pls advise.
    I'm just learning jsp's and servlets myself. The basic idea is that you start with an html page with a form on it. An html form tag has an action attribute where you list a jsp page. After the user fills out the form and clicks on the submit button, the names of the form fields along with their associated values are sent to the server along with a request for the jsp page. However, before the server sends the requested page back to the browser, any Java between the tags:
    <% .... %>
    is executed by Tomcat. The java code that executes can use the request object to get the values the user entered into the form.
    In your html, you don't even have an action attribute for the form tag. As a result, when you click on a button, which subsequently calls a javascript function that submits the form, nothing happens.

Maybe you are looking for