This is a migrated thread and some comments may be shown as answers.

RadWindowManager & w3c

1 Answer 98 Views
Window
This is a migrated thread and some comments may be shown as answers.
arnaud
Top achievements
Rank 1
arnaud asked on 15 Dec 2008, 03:01 PM
Hi,

It seems that the code generated by a radwindowmanager generates w3c errors :

Error 1 :
Line 352, Column 11: required attribute "type" not specified.
				<script>

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.

Error 2 :

Line 375, Column 17: character "{" is not allowed in the value of attribute "id".
				<a id="OKbtn_{0}" onclick="$find('{0}').callBack(this.parentNode.parentNode.

It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.

My RadWindow Manager :

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" Behaviors="Close, Move, Resize" 
            OnClientShow="OnClientShow" Modal="true" IconUrl="~/App_Themes/prod/img/lsdm.gif"
        </telerik:RadWindowManager> 

The code it generates where the w3c occurs:

<div id="ctl00_CPHsidebar_RadWindowManager1_prompttemplate" style="display:none;"
        <div class="windowpopup radprompt">          
            <div class="dialogtext"
            {1}              
            </div>       
            <div> 
                <script> 
                function radwindowprompt_detectenter(id, ev) 
                {                            
                    if (!ev) ev = window.event;                 
                    if (ev.keyCode == 13) 
                    {                                        
                        var but = document.getElementById("OKbtn_"+id);                                                                            
                        if (but) 
                        {                            
                            if (but.click) but.click(); 
                            else if (but.onclick) 
                            { 
                                but.focus(); var click = but.onclick; but.onclick = null; if (click) click.call(but);                             
                            } 
                        } 
                       return false; 
                    }  
                    else return true; 
                }     
                </script> 
 
                <input  onkeydown="return radwindowprompt_detectenter('{0}', event);" type="text"  class="dialoginput" value="{2}" /> 
            </div> 
            <div> 
                <id="OKbtn_{0}" onclick="$find('{0}').callBack(this.parentNode.parentNode.getElementsByTagName('input')[0].value);"                
                    class="radwindowbutton" href="javascript:void(0);" ><span class="outerspan"><span class="innerspan">##LOC[OK]##</span></span></a> 
                <onclick="$find('{0}').callBack(null);" class="radwindowbutton"  href="javascript:void(0);"><span class="outerspan"><span class="innerspan">##LOC[Cancel]##</span></span></a> 
            </div> 
 

Is there a way to make the w3c validate that ?

Thank You

Regards

Arnaud Boiselle


1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 16 Dec 2008, 08:31 AM
Hello Arnaud,

This problem was reported and has already been corrected in our internal builds.
The next update (Q3 2008 SP2) of Telerik RadControls will feature properly validating RadWindowManager.
In the meantime, in case you need to have the manager to validate immediately, you can replace its prompt template with a validating version.

Here is how to do it
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="WebBlue" Behaviors="Close, Move, Resize"  
            OnClientShow="OnClientShow" Modal="true" IconUrl="~/App_Themes/prod/img/lsdm.gif">  
<PromptTemplate> 
 <div class="windowpopup radprompt">             
                <div class="dialogtext"
                {1}              
                </div>       
                <div> 
                    <script type="text/javascript"
                    function radwindowprompt_detectenter(id, ev, input) 
                    {                            
                        if (!ev) ev = window.event;                 
                        if (ev.keyCode == 13) 
                        {                                                                    
                            var but = input.parentNode.parentNode.getElementsByTagName("A")[0];                          
                            if (but) 
                            {                            
                                if (but.click) but.click(); 
                                else if (but.onclick) 
                                { 
                                    but.focus(); var click = but.onclick; but.onclick = null; if (click) click.call(but);                             
                                } 
                            } 
                           return false; 
                        }  
                        else return true; 
                    }     
                    </script> 
                    <input  onkeydown="return radwindowprompt_detectenter('{0}', event, this);" type="text"  class="dialoginput" value="{2}" /> 
                </div> 
                <div> 
                    <onclick="$find('{0}').callBack(this.parentNode.parentNode.getElementsByTagName('input')[0].value);"               
                        class="radwindowbutton" href="javascript:void(0);" ><span class="outerspan"><span class="innerspan">##LOC[OK]##</span></span></a> 
                    <onclick="$find('{0}').callBack(null);" class="radwindowbutton"  href="javascript:void(0);"><span class="outerspan"><span class="innerspan">##LOC[Cancel]##</span></span></a> 
                </div> 
</PromptTemplate> 
 
        </telerik:RadWindowManager>  



All the best,
Tervel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
arnaud
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or