开发者

Dojo: Why an extra text box is produced?

开发者 https://www.devze.com 2023-04-11 13:58 出处:网络
The following part of code produces this result in Firefox and Chrome <html> <title>Dojo Example</title>

The following part of code produces this result in Firefox and Chrome

Dojo: Why an extra text box is produced?

<html>
    <title>Dojo Example</title>
    <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js" 
    djConfig="parseOnLoad: true">
    </script>
    <script type="text/javascript"> 
    dojo.require("dojo.parser");
    dojo.require("dijit.form.ValidationTextBox")
    </script>
    <label for="firstName"> First Name: </label>
    <input type="text" id="firstName"
    dojoType="dijit.form.ValidationTextBox"
    promptMessage="Enter first name:"
    invalidMessage="First Name is required"
    />
</html>

An extra text box is produced with text "X" on it. I have no idea how to fix it and why does this happen. Anyone can 开发者_如何学JAVAhelp?


You need to add a valid dijit theme to the body tag of your html document, in addition to including a to the css stylesheet of the theme you want to use.

for example:

<html>
    <head>    
        <title>Dojo Example</title>
        <link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.6/dijit/themes/claro/claro.css">
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js" 
            djConfig="parseOnLoad: true">
        </script>
        <script type="text/javascript"> 
            dojo.require("dojo.parser");
            dojo.require("dijit.form.ValidationTextBox")
        </script>
   </head>
   <body class="claro">
        <label for="firstName"> First Name: </label>
        <input type="text" id="firstName"
            dojoType="dijit.form.ValidationTextBox"
            promptMessage="Enter first name:"
            invalidMessage="First Name is required"
        />
   </body>
</html>
0

精彩评论

暂无评论...
验证码 换一张
取 消