The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
<textarea> proprietary attribute
hii..
Here's a simple HTML code for textarea. I am using MaxChars attribute which is used further in some Javascript. But it is proprietary thus it gives 1 XHTML validation error. HTML Code:
<textarea MaxChars="1000" name="description" id="description" rows="6" cols="50">Testing</textarea> Note:- It works perfect. All I want to know is how to replace MaxChars with its equivalent that is XHTML valid. |
#2
|
||||
|
||||
anyone ??
|
#3
|
|||
|
|||
You can use the setattribute function to set it before your javascript code.
Code:
element.setAttribute('MaxChars', 1000); |
#4
|
||||
|
||||
thanks for replying but i'm not sure how to make it work !
see this is my actual textarea:- HTML Code:
<!-- Text Area --> <textarea MaxChars="1000" name="description" id="description" rows="6" cols="50" style="width:540px" onkeypress="if (this.value.length >= parseInt(this.attributes['MaxChars'].value)) return false;" onkeyup=" document.getElementById( this.id+'_charsCount' ).innerHTML = (parseInt(this.attributes['MaxChars'].value)-parseInt(this.value.length));"></textarea> <!-- Text Area --> As you can see all my JS is within onkeypress and onkeyup attribute of textarea. Now how do I use setattribute for MaxChars ? Thank you |
#5
|
||||
|
||||
Can't you not use a maxchars attribute, but instead, but the number directly into the function for comparison? Or maybe even store it in a JS variable?
|
#6
|
||||
|
||||
oh great ! Thank you so much, I directly used the number and it worked perfect.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|