Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New atributes in Firefox

Status
Not open for further replies.

irida

Programmer
Sep 29, 2006
10
UA
Hello!
Can you help me? I'm trying to add a new attribute (mask) to the input tag, but Firefox don't understand variable this.mask (while IE understanding it). As far, as I understood, this happens because "mask" - is not standard atribute of the input tag. Am I right?
And is there a way to pass this atribute to javascript, without writing it directly in the call of the function (I mean checkMas('$$$-$$$'))
Thanks a lot! :)
 
oelem.getAttribute("mask")" - thanks a lot, but what is "oelem" :-[
 
<CODE>
el.setAttribute('mask', '$$$-$$$');
</CODE>
Thanks, but I need to mask directly in tag and pass it to script, because I need 1 script to work with different masks
 
Oh yes, surely. I'm sorry:)
I'd like to say, that I need to SET mask directly in tag. It means, I use the same javascript for different patterns, and I need somehow to tell the script, how to validate input text. Sorry, if it isn't clear enough yet
 
Well - you can do this, but it won't validate:

Code:
<input type="text" mask="$$$-$$$" onchange="doSomeValidation(this.mask, this.value);" />

Note: I've not tried the above - I'm only assuming that it will work.

Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
It works in IE, but not in Firefox, Firefox doesn't understand what is "this.mask
 
How about showing your code so we can see what you have? Copy and paste it in, don't retype it. That way we see what the browser is dealing with and can test it ourselves.

Lee
 
Risk to repeat myself.
[tt] onchange="yourfunction(this.getAttribute('mask'),this.value)"[/tt]
 
2tsuji: Thanks a lot! It's really working. Sorry, hadn't understood for the first time!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top