Jump to content

dedyandy

Members
  • Posts

    12
  • Joined

  • Last visited

dedyandy's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Could you please tell me how to code, if the key is <Enter>, then the keyup handler does not run?
  2. Sorry if I have phrased my question not clearly. The key issue of the problem here is the "alert box". I have added your code with the "alert box". In Firefox, when I press <Enter> the alert box does not disappear (it keeps popping up), unless I click it with the mouse. This does not happen with IE. <html><head><script type="text/javascript">function upperCase(x){var y=document.getElementById(x).valuedocument.getElementById(x).value=y + "-"alert ("Hello");}</script></head><body>Enter your name: <input type="text" id="fname" onkeyup="upperCase(this.id)"><br>Enter your name: <input type="text" id="lname" onkeyup="upperCase(this.id)"></body></html>
  3. The form has five editable text fields. Even the form has only one text field, the problem is the same. Because, when the focus is in that text field, it means that the field has not lost focus. So, onchange event has not been triggered yet. As a result, the subtotals and total have not been updated. The requirement here is that everytime the user enters a quantity, the subtotals and total are updated instantly. In other words, the user wants to see his subtotals and total, before he places the order or presses the submit button. This means that after the user presses and releases the key on the keyboard. That's why I think this requirment can only be served with onkeyup event handler. But this only works with IE, as I have said in my first post.
  4. I have tried using onchange, it had another problem. When the user changes the quantity, and he does not leave the field (the cursor remains in the element). As a result, he would wait for the subtotals and total to be updated, but nothing happens.
  5. I removed the focus and select, but it didn't help. It seems that Mozilla Firefox registers onkeyup event to all objects, when we register a particular object.The reason that I use this functionality is that I have an order form for a bookshop. Everytime a user enters a new quantity, then the form automatically updates the subtotals and total.Do I have any other solutions for the above requirement to overcome this cross-browser problem?
  6. Hi All,From the script below, when the user enters a number 0 or bigger than 5, the alert box keeps on popping up when pressed with <Enter> on a keyboard. This only happens when using with Mozilla Firefox, but not with Internet Explorer.It seems that Mozilla Firefox does not properly handle the onkeyup event.Does anyone experience the same thing?Thanks,Andy.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>Test</title><script type="text/javascript">function updateForm(dom){ var qty = document.getElementById(dom).value; if (qty != "") if (qty == 0 || qty > 5) { alert ("The number may not be 0 and not bigger than 5!"); document.getElementById(dom).select(); document.getElementById(dom).focus(); }}</script></head><body><form action="#">Enter a number:<td> <input type = "text" name = "qty1" id = "qty1" value="0" size="15" onkeyup = "updateForm('qty1');" /> </td></form></body></html>
  7. Hi All,Could anyone help me for how to put the "$" sign in front of a number, but the number still can be calculated using Javascript. In other words, the content of a tag is only the number, but when displayed it puts the "$" sign in front of a number.Thanks,Andy.
  8. I don't how to write XML with DTD and XLS in CGI Perl? Could anyone help me for any sites that covers Perl XML?Thanks,Andy.
  9. dedyandy

    Case Sensitivity

    I have looked from some sources including the official site of MySQL of how to compare string with case sensitivity, but I failed to understand it.Could anyone help me of how to convert the following non-case sensitivity expression to the expression that includes case sensitivity:SELECT Count(*) FROM member WHERE username='uname' AND password='pw'.I use MySQL version 4.0.Thanks,Andy.
  10. Sorry, I am not really sure from your suggestion by giving a link to both a working file and a non-working file. I have given a link in a working file to a non working file. When I clicked the link, then there was still the same error message.To be more precise, I run an html file and two CGI files. The top part of the html file is:<?xml version = "1.0" encoding = "utf-8"?><!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><!-- conelec.html A document to present the user with a consumer electronics purchasing survey form --><html xmlns = "http://www.w3.org/1999/xhtml"> <head> <title> Consumer Electronics Purchasing Survey </title> </head> <body> <form action = "./cgi-bin/conelec1.cgi" method = "post">...A number of variations I have tried to solve the problem, such as:1. I removed the value of action tag to be an empty string.2. It sounds silly but worth to try that I changed the top part above with the top part of the working file, that actually is exactly the same thing.However, with the above effort, there was still the same error message.
  11. My computer runs XP Pro, Apache, MySQL, and PERL. I am having problem running the html file. I received the error message when I accessed it via http://localhost:80/page408.html. However, it only happened with this file. Strangely, when I replaced the content of the file with the contents of other files which run ok, I received the same error message.The error message is:The XML page cannot be displayed.Cannot view XML input using style sheet. Please correct the error andthen click the Refresh button, or try again later.Parameter entity must be defined before it is used. Error processing resource'http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd'.Line 85, Position 2%xhtml-prefw-redec1.mod;_^Could anybody help me with this problem? Thanks,Andy.
  12. From a call of setTimeout("moveText(" + x + "," + y + ")", 1), could anybody help why the first parameter of setTimeout method takes the form of " + x + "," + y + "? Why not setTimeout(“moveText(x,y)”, 1)?Please note that x and y are used as numbers in moveText function.Thanks,Andy
×
×
  • Create New...