XHTML Strict Validation For Custom Attributes?
May 1, 2010
how I can get my custom attributes to validate in XHTML Strict? I have to have it validate as it is for a class.Example of the form:
HTML Code:
input onkeyup="TF_filterTable(document.getElementById('dataTable'), filter)" size="40" tf_colkey="name"tf_searchtype="substring" />
Example of the JS:
Code:
var inputs = frm.getElementsByTagName("INPUT");
for (var i=0;i<inputs.length;i++)
{ //looping thru all INPUT elements[code].........
View 2 Replies
ADVERTISEMENT
Jul 11, 2002
does anyone know of any sites that use (validating) xhtml strict, and also use javascript functions - rollovers etc?
(the strict dtd won't allow you to use the "name" attribute, in images, so I want to find out what the solution is to this problem)
View 4 Replies
View Related
Dec 19, 2004
I am coding xhtml strict for my pages for the first time and I got some one problem with javascript:
I don't know how to modify the scripts to target elements on the page where the name attribute is deprecated.
Eg.
Code:
<form action="test.php" method="post">
<div><input name="text" />
<input type="submit" name="submit" value="search" /></div>
</form>
how can I modify the code to select such fild in such form ?
The following one is not working:
document.form.text.focus();
View 8 Replies
View Related
Aug 10, 2009
I am using a javascript to validate that all form fields are filled in here:[URL].. The form input fields in the top div can be validated no problem. However, when I add to the javascript, this section of code:
Code:
if (document.forms['secondform'].firstname.value=="") {
themessage = themessage + " - First Name
";
}
And so on for the next few input boxes, the javascript stops working entirely, passing the user onto the next page without actually validating the fields. I feel it is because I am not calling the input boxes correctly in the javascript, but I am unsure how to do it.
I was thinking that maybe because they are in a different division if I added that in there somewhere I could get it clear up, but no such luck yet.
View 3 Replies
View Related
May 10, 2009
Adsense ads are not working on a site with XHTML 1.0 Strict doctype which is served as text/html. Any ideas what could be the problem?
One more thing, the ads show up on my localhost properly.
View 5 Replies
View Related
Sep 28, 2007
Let's say i defined my own attribute, called "counter".
<div id="myid" counter="2">test</div>
I know I can read this value trough:
document.getElementById('myid').getAttribute('counter');
But is it possible to add the counter attribute to javascripts known attributes, so I could access it like:
document.getElementById('myid').counter;
View 3 Replies
View Related
Aug 15, 2007
How do you get JS to validate? Am more or less positive my JS used to validate now the following won't even pass
if(1==1 && 2==2)
{
}
why? because the validator wants &&
Any ideas how even that script can be validated. The doc type is transitional.
View 4 Replies
View Related
May 31, 2010
I sometime find it useful to add my own attribute to a HTML tag so that my javascript can access those elements.
For instance, new_attribute in the following anchor tag:
<a href="#" class="someclass" new_attribute="some_value">Click Me</a>
When trying to validate this page, however, it doesn't pass. Some of the below questions likely do not make sense, but I hope you get the idea what I am looking for:Is what I am doing bad practice?Is there another way to allow javascript to specifically select just some elements and not others? Should I instead apply multiple classes to the element, and use some of the classes not to modify appearance, but to allow just them to be selected?If using custom attributes, should they somehow be defined so they pass validation?
View 12 Replies
View Related
Mar 29, 2011
I have some attributes that aren't really standard attributes:
e.g.
<option additional="34">Deep Purple</option>
That "additional" attribute is an attribute that I use with Jquery to add an additional price to the item.How many browsers will work with custom attributes like that? Or will I have to use a standard attribute (Note: if I use Value it overwrites the value inside of the option).
View 1 Replies
View Related
Dec 15, 2009
// This is asp.net snippet
<marquee id="marqueeLeft" class="marqueestyle" direction="up" onmouseout="this.start();" onmouseover="this.stop();"
scrolldelay="500" style="height: 99px; width: 100%;" >
<asp:PlaceHolder ID="LeftPlaceHolder" runat="server"></asp:PlaceHolder>
</marquee>
When I moved the pointer to this <marquee> tag. It shows the error message "Validation (xhtml 1.0 transitional) element marquee is not supported". When i run my web app it runs successfully but it gives jscript error as System.Argument Exception as value for controls and behaviors must not be null.
View 8 Replies
View Related
Sep 28, 2010
Has anyone performed or seen a customization of validatepassword? I'm looking to create a custom validation and don't know where to start.
View 5 Replies
View Related
Apr 18, 2011
I am using this jQuery Form Validation Plugin [URL].. But unable to get proper tutorial to use it in custom way. E.g : I have written a custom form below.. My Query is how can I control validation on a form element.Say in the following textbox named txtPaymentFirstName only Alphabet and space allowed, no special character or numbers allowed , how to do that?
Also I want only in the following textbox txtURL, valid URLs will be written, how to incorporate that rule?
[Code]...
View 1 Replies
View Related
Jul 22, 2009
I have added a method on jQuery validator like this
$.validator.addMethod('myEqual', function (value, element) {
return value == element.value; // this one here didn't work :(
}, 'Please enter a greater year!');
$.metadata.setType("attr", "validate");
[Code].....
View 2 Replies
View Related
Jul 12, 2010
Let say I have the following form. I need to put the error message of the checkbox a bit differently from the other element. The point is that I don't want the error message between the checkbox and the text. Let say I have:
Name: [textbox] error here (required)
Email: [textbox] error here (required + email)
Interests: (at least 2 checked)
[code]....
View 2 Replies
View Related
Jan 26, 2011
Im using the jquery validation plugin: [URL] The forms are generated dynamically using php, with the standard class 'required' the plugin looks for, however when it comes to adding my custom rules i want them to be dynamic, as the name/id attributes are generated based on what the id of the form is: i.e. the form ID is #comp so an input would have a name attribute of comp_forename, comp_surname so basically the validator is initiated by looking in the body for a form: var form_id = $('body form').attr('id'); Then how can icancatante the strings to created the name attributes dynamically in the rules here:
[URL]
View 1 Replies
View Related
Nov 17, 2010
I created a custom validation like this <script type="text/javascript">
[Code]...
View 2 Replies
View Related
Sep 23, 2010
So I created a custom rule following numerous examples out on the web for a dynamic text input, but for some reason it seems to be letting spaces through even though my regexp tests out ok to not match when the value is any combination of spaces...
$.validator.addMethod("noSpace", function(value, element){
return this.optional(element) || /^[a-z0-9][a-z0-9_ ]{0,70}$/i.test(value);
}, "Please enter a name starting with either a letter or a digit.");
$('#form').validate({
rules: {
[Code]...
The odd thing is, it will work if you type in a space followed by a character, but if you type in one space, or one space followed by x number of spaces, it just lets it through like it's valid. But yet when I look at the demos and examples that I pulled this from, they never let those scenarios go through.
[Code]...
View 5 Replies
View Related
Nov 16, 2006
I am now using a strict !DOCTYPE and want to ensure that my pages comply. The Javascript I used to use no longer works - how can I seperate it from the structure of the page?
<input name="rdo1" id="rdo12" type="radio" checked="checked" value="didnt"
<textarea name="txtarea1" id="txtarea1" cols="20" rows="5">
<script type="text/javascript">
/*
Clear default form value
*/
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>
View 3 Replies
View Related
Oct 12, 2010
1- I have a Tabs list (Services/Solutions/Internal...) in below website which has been done using Javascript.
[URL]
Now if I change the Doctype from Strict to Transitional the javascript ceases to work correctly (and I was not able to find why).
See here:
[URL]
2- I need the Transitional doctype because my language menu does not work with Strict!!! and I guess fixing the Javascript might be easier than that.
What is the problem? What should I do to avoid such problems? (I guess I prefer strict type XML documents).
View 3 Replies
View Related
Aug 25, 2010
I was able to achieve Collapsing/Expand at Project Level but not at the vendor level. However, same HTML works fine with IE 8 and FF. The Expand/Collapse at the Vendor Level fails with XHMTL Strict 1.0 and IE 7.
View 1 Replies
View Related
Nov 30, 2005
I am trying to include and xml document inside my xhtml document. There
are a number of reasons for this including portability, multiple
interface generation, and scalability of information.
My problem is that javascript is understanding the nodes in my xml
document as html elements.
<xml>
<book>
<title>Lord of the Rings</title>
</book>
</xml>
If I parse this, the title element cannot be extracted and the page
title(in the browser) becomes "Lord of the Rings".
Is there a way to exclude this xml node from the xhtml rules?
View 6 Replies
View Related
Feb 27, 2007
Maybe you can answer a question for me: I'm reading the preview for XML web development (sitepoint book) and it clearly shows IE rendering XML (the author states IE5 and above); does that mean that IE's problem with XHTML is CDATA and not XML universally? If that's true then IE could render an albeit gimped XHTML page which would explain why HTML 4.01 and XHTML are virtually synonymous in IE 6.
Is there a workaround for this in JavaScript, if the above is true?
View 5 Replies
View Related
Dec 23, 2005
I'm facing the bug about the failure of innterHTML while
reading xhtml content inside a DIV, in fact it has passed as html
removing the closing of some nodes. Is there a way to read the content
of the div perfectly how it is in the page, kind of:
var obj = document.getElementById("myDIV");
var realContent = obj.toString();
View 22 Replies
View Related
Jul 20, 2005
IE6 in standards mode doesn't seem to hide scrollbars on the body element
(overflow:hide) Ain't this a quandary. I have it in my head that I need to
specify html instead. The scrollbars do hide on Gecko browsers though, so
there is definitely a disagreement among browser developers on how to
implement scrollbars (as a side note, Gecko browsers with their notoriously
bug-ridden resize code seem to always screw up when asked to stretch and
scroll divs, even when the page is reloaded on every resize!)
My first thought is to modify the CGI that generates the style sheet as I
already have code that deprecates the document type when hidden scroll bars
are required on IE6 (but not IE5.) This is based on the simple empirical
evidence that the scroll bars are still there on IE6 in standards mode, so
the optimal document type (XHTML strict) cannot be used. So I could just
change this to output an html style (rather than a body style) for IE6 and
lose the deprecation (it wouldn't be needed at this point.)
So the question is this. Given that CGI-based processing of browser
versions for these kinds of tweaks is taboo, what would you check on the
client side before dynamically generating the style for the body and/or html
element? It doesn't seem like you could just send both as this would surely
break some older browsers (I know you can do tricks with comments and such,
but that only works for NS4 and maybe IE3 AFAIK.)
documentElement is the only thing I can think of that indicates standards
mode and NS6/Mozilla support this AFAIK.
IE Conditional comments perhaps? I would hate to hard-code a test for a
browser version number into the actual document (for obvious reasons), but I
guess it is an alternative if the browser version is exposed to these
things.
I don't see any other way to deal with a situation like this than with
server-side code that looks at the browser's version number and makes the
necessary adjustment. And there are lots of little differences like this
that just don't seem to have viable client-only solutions. There's DirectX
stuff (probably is an object detect for that) and funky colored scrollbars
(hey people ask for them) and document margins (Opera did them slightly
differently than the rest as I recall) and now this scrollbar thing.
View 24 Replies
View Related
Jul 23, 2005
There are two main things which I am trying to work through:
Drop down menu (bottom of page) - which only works in IE (on pc) right
now, although it should work on all browsers except opera.
Traditionally in a HTML 4.0 Transitional environment.
Div content that scrolls - placed correctly and works in IE and that's
it. Here is an example of the working script on another site
http://www.dyn-web.com/dhtml/scroll/scroll-rel.html . Traditionally in
a Xhml strict.
My goal is to get this page to look as good in Netscape and on the mac
as it already does in IE.
View 2 Replies
View Related
Jul 23, 2005
When using innerHTML to insert xhtml IE5+ mangles the xhtml completely. For example it removes the quotes from attributes. It also does other ridiculous things like on a <div> it will insert the enbedded style="DISPLAY:BLOCK"! This is a documented feature you can find in msdn.
Is there a way to disable this quite appalling feature?
View 10 Replies
View Related