I'm having the following problem: I use the javascript function bellow to manage the key up function. The problem is when I re-create an input with the same id the Firefox gets the last input value.
You can use the script on http://pastebin.com/7isVQ6Vm to try, just press the button "Novo input" press something check the value printed press the button again and try a new value check what happens.
Is there a way to totally erase a input? I already tried the javascript delete function... checked the settimeout return do clean but nothing worked.
function onKeyUpHandler(campo, funcao, tempo,paramentro)
{
var searchTimeout;
campo.onkeyup = function (event)
{
var tecla = (window.Event) ? event.which : event.charCode;
if (typeof searchTimeout != "undefined") clearTimeout(searchTimeout);
if (typeof paramentro == "undefined") paramentro = "";
else{var string = new String(paramentro);
if (string.substr(0,1)!=',') paramentro = ",'"+paramentro+"'"; }
searchTimeout = setTimeout(funcao+"("+campo.id+","+tecla+paramentro+")", tempo);
};
}
onKeyUpHandler - new input
- malliz
- Folder@Home
- Posts: 43796
- Joined: December 7th, 2002, 4:34 am
- Location: Australia
Re: onKeyUpHandler - new input
Is this for a web page or an extension?
What sort of man would put a known criminal in charge of a major branch of government? Apart from, say, the average voter.
"Terry Pratchett"
"Terry Pratchett"
-
- Posts: 5
- Joined: February 3rd, 2011, 5:05 am
Re: onKeyUpHandler - new input
web page
- DanRaisch
- Moderator
- Posts: 127247
- Joined: September 23rd, 2004, 8:57 pm
- Location: Somewhere on the right coast
Re: onKeyUpHandler - new input
Moving to Web Development.
-
- Posts: 52
- Joined: July 24th, 2014, 6:02 am
- Location: Australia
Re: onKeyUpHandler - new input
Unable to reproduce the problem in Firefox 35.0.1
After I click < Novo Input > and type "123", < Novo Input > and type "345", < Novo Input > and type "456", I get
Personally I remove text filled in by Firefox when it considers a form element dirty after reload by setting the value property, of the input element, to the empty sting ("") after page load.
After I click < Novo Input > and type "123", < Novo Input > and type "345", < Novo Input > and type "456", I get
as expected from the code. Have I misunderstood some part of the problem or are you testing with an older version of Firefox?[object HTMLInputElement]|51
[object HTMLInputElement]|53
[object HTMLInputElement]|54
123
345
456
Personally I remove text filled in by Firefox when it considers a form element dirty after reload by setting the value property, of the input element, to the empty sting ("") after page load.
-
- Posts: 5
- Joined: February 3rd, 2011, 5:05 am
Re: onKeyUpHandler - new input
Hi,
I got the problem on previous version.
Thank you!
I got the problem on previous version.
Thank you!
- patrickjdempsey
- Posts: 23686
- Joined: October 23rd, 2008, 11:43 am
- Location: Asheville NC
- Contact:
Re: onKeyUpHandler - new input
Which "previous version" exactly?
Tip of the day: If it has "toolbar" in the name, it's crap.
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/
What my avatar is about: https://addons.mozilla.org/en-US/seamonkey/addon/sea-fox/