473,665 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

minLength and maxLength

ray
My xsd has the following element:
<xs:element name="Company" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>

when i change the maxLength to what i really want(64) it seems to
ignore both. Is it me or is there something i am not seeing. Below is
my validation routine in my .net program.
XmlTextReader xml = new XmlTextReader(S aveLocation);
XmlValidatingRe ader xsd = new XmlValidatingRe ader(xml);
xsd.ValidationT ype = ValidationType. Schema;
xsd.ValidationE ventHandler += new
ValidationEvent Handler(MyValid ationEventHandl er);
while (xsd.Read())
{
if(xsd.NodeType == XmlNodeType.Ele ment)
{
switch(xsd.Name )
{
case "data":
break;
case "lead":
numOfleadNodes +=1;
columnCount=0;
break;
default:
columnCount +=1;
break;
}
string parentElementNa me = xsd.Name;
columnName=xsd. AttributeCount. ToString();
}
}
xsd.Close();
xml.Close();
thanks

Ray

Nov 12 '05 #1
7 2609
Please post your XML that you are trying to validate with the given schema.

Thanks.

<ra*@cape.com > wrote in message
news:11******** **************@ o13g2000cwo.goo glegroups.com.. .
My xsd has the following element:
<xs:element name="Company" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>

when i change the maxLength to what i really want(64) it seems to
ignore both. Is it me or is there something i am not seeing. Below is
my validation routine in my .net program.
XmlTextReader xml = new XmlTextReader(S aveLocation);
XmlValidatingRe ader xsd = new XmlValidatingRe ader(xml);
xsd.ValidationT ype = ValidationType. Schema;
xsd.ValidationE ventHandler += new
ValidationEvent Handler(MyValid ationEventHandl er);
while (xsd.Read())
{
if(xsd.NodeType == XmlNodeType.Ele ment)
{
switch(xsd.Name )
{
case "data":
break;
case "lead":
numOfleadNodes +=1;
columnCount=0;
break;
default:
columnCount +=1;
break;
}
string parentElementNa me = xsd.Name;
columnName=xsd. AttributeCount. ToString();
}
}
xsd.Close();
xml.Close();
thanks

Ray

Nov 12 '05 #2
ray
the xml file:
<?xml version="1.0" ?>
- <data xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "LeadXSD.xs d">
- <lead>
<Company />
<Address1>sssss ssssss</Address1>
<Address2 />
<City />
<State />
<Postal_Code_Id >B-9200</Postal_Code_Id>
<Country>Belgiu m</Country>
<Country_Id />
<First_Name />
<Last_Name />
<Email />
<Title>Applicat ion Manager</Title>
<Phone_Country_ Code>32</Phone_Country_C ode>
<Phone_Area_Cod e />
<Phone>3 8869801</Phone>
<Ext />
<Fax_Country_Co de />
<Fax_Area_Cod e />
<Fax />
<Rep>VANDEP</Rep>
<Salesteam />
<Territory_Id />
<Lead_Status> To Be Qualified</Lead_Status>
<Priority>3 - Medium</Priority>
<AddAuth />
<Account_Id>1 </Account_Id>
<Account_Contac t_Id />
<Acct_Location_ Id />
<Num_Of_Employe es />
<Department />
<Salutation>M r</Salutation>
<Comments />
</lead>
</data>

the xsd file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" >
<xs:simpleTyp e name="CompanySt ring">
<xs:annotatio n>
<xs:documentati on>Company string</xs:documentatio n>
</xs:annotation>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
<xs:element name="data">
<xs:complexType >
<xs:choice maxOccurs="unbo unded">
<xs:element name="lead">
<xs:complexType >
<xs:sequence>
<xs:element name="Company" minOccurs="0"
type="CompanySt ring"></xs:element>
<xs:element name="Address1" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Address2" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="City" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="State" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Postal_Co de_Id" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Country" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Country_I d" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="First_Nam e" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Last_Name " minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Email" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="132" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Title" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phone_Cou ntry_Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phone_Are a_Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="8" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phone" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Ext" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Fax_Count ry_Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Fax_Area_ Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="8" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Fax" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Rep" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Salesteam " minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="80" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Territory _Id" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Lead_Stat us" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Priority" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AddAuth" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string "></xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Account_I d" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :integer ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Account_C ontact_Id" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :string ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Acct_Loca tion_Id" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :string ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Num_Of_Em ployees" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :string ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Departmen t" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Salutatio n" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Comments" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="2000" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

this is driving me simply batty. thanks for your help.

Ray

Nov 12 '05 #3


ra*@cape.com wrote:

<?xml version="1.0" ?>
- <data xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "LeadXSD.xs d"> <?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" >


You need
elementFormDefa ult="unqualifie d"
if you want your elements to be in no namespace.
Not sure whether that causes your problem but you should fix that.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #4
There are problems with the XML that you posted. In the XML, Company,
First_Name and Last_Name have no content and in the schema they have a
minLength facet of 1. So this will not validate.

I fixed that by putting minLength=0 on the types, and it validates fine for
me for all values of maxLength (yes I tried 64 as well). What error or
behavior do you see which leads you to believe that there is a problem?

Thanks.
<ra*@cape.com > wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
the xml file:
<?xml version="1.0" ?>
- <data xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespace SchemaLocation= "LeadXSD.xs d">
- <lead>
<Company />
<Address1>sssss ssssss</Address1>
<Address2 />
<City />
<State />
<Postal_Code_Id >B-9200</Postal_Code_Id>
<Country>Belgiu m</Country>
<Country_Id />
<First_Name />
<Last_Name />
<Email />
<Title>Applicat ion Manager</Title>
<Phone_Country_ Code>32</Phone_Country_C ode>
<Phone_Area_Cod e />
<Phone>3 8869801</Phone>
<Ext />
<Fax_Country_Co de />
<Fax_Area_Cod e />
<Fax />
<Rep>VANDEP</Rep>
<Salesteam />
<Territory_Id />
<Lead_Status> To Be Qualified</Lead_Status>
<Priority>3 - Medium</Priority>
<AddAuth />
<Account_Id>1 </Account_Id>
<Account_Contac t_Id />
<Acct_Location_ Id />
<Num_Of_Employe es />
<Department />
<Salutation>M r</Salutation>
<Comments />
</lead>
</data>

the xsd file:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefa ult="qualified" >
<xs:simpleTyp e name="CompanySt ring">
<xs:annotatio n>
<xs:documentati on>Company string</xs:documentatio n>
</xs:annotation>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
<xs:element name="data">
<xs:complexType >
<xs:choice maxOccurs="unbo unded">
<xs:element name="lead">
<xs:complexType >
<xs:sequence>
<xs:element name="Company" minOccurs="0"
type="CompanySt ring"></xs:element>
<xs:element name="Address1" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Address2" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="City" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="State" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Postal_Co de_Id" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Country" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Country_I d" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="First_Nam e" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Last_Name " minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Email" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="132" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Title" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phone_Cou ntry_Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="5" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phone_Are a_Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="8" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Phone" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Ext" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Fax_Count ry_Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Fax_Area_ Code" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="8" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Fax" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Rep" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Salesteam " minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="80" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Territory _Id" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Lead_Stat us" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="20" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Priority" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:minLength value="1" />
<xs:maxLength value="16" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="AddAuth" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string "></xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Account_I d" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :integer ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Account_C ontact_Id" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :string ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Acct_Loca tion_Id" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :string ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Num_Of_Em ployees" minOccurs="0">
<xs:simpleTyp e>
<xs:union memberTypes="xs :string ">
<xs:simpleTyp e>
<xs:restricti on base="xs:token" >
<xs:length value="0" />
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:element>
<xs:element name="Departmen t" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="64" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Salutatio n" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="32" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Comments" minOccurs="0">
<xs:simpleTyp e>
<xs:restricti on base="xs:string ">
<xs:maxLength value="2000" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>

this is driving me simply batty. thanks for your help.

Ray

Nov 12 '05 #5
ray
first off, thanks for all the help. it seems that if i have a minLength
of 1 and a maxLength of 64 and the xml for the company field has no
data it still passes the xsd validation. it seems to me that if company
has nothing in it and i have a minlength of 1 it should fail? is this
correct?

Ray

Nov 12 '05 #6
The maxLength value of 64 should not matter, the empety element <Company/>
should NOT validate if minLength=1 in the schema for its type

<ra*@cape.com > wrote in message
news:11******** *************@g 14g2000cwa.goog legroups.com...
first off, thanks for all the help. it seems that if i have a minLength
of 1 and a maxLength of 64 and the xml for the company field has no
data it still passes the xsd validation. it seems to me that if company
has nothing in it and i have a minlength of 1 it should fail? is this
correct?

Ray

Nov 12 '05 #7
ray
But it does and i have no idea why. At this point i am really stressing
about this and don't know what to do. Has anyone else come across this
before?

Thanks Zafar for your time.

Ray

Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
11440
by: Lovely Dola | last post by:
I have set the MaxLength property of a textbox in a form to 5 at design time. When I change the MaxLength back to 0 during run-time under some condition (for example, after clicking a command button), I can still only enter at most 5 characters into the textbox. So how can I reset the textbox to allow unlimit text to be entered?
1
2026
by: Don Adams | last post by:
I have this defined in my schema: <xsd:simpleType name="addressType"> <xsd:restriction base="xsd:hexBinary"> <xsd:minLength value="1"/> <xsd:maxLength value="8"/> </xsd:restriction> </xsd:simpleType> I was hoping this would allow values to be entered like "00" and "FFFFFFFFFFFFFFFF"; however,
5
7444
by: Edward Mitchell | last post by:
I have a database with text string fields defined by varchar(nnn). When I request from the user the text from a textbox, I'd like to set the maximum number of characters in the textbox to the "nnn" that was used in the varchar(...) statement in the field definition. i.e. Field1 varchar(25) NOT NULL and in the .aspx file: <asp.textbox id=Field1 runat="server" />
4
8158
by: hardcoded | last post by:
I have a textbox with TextMode set to MultiLine. I also have the MaxLength set to 255. This maxlength value seems to get ignored as the user can enter unlimited characters. Does the multiline textbox not support maxlength? How can I make the work? TIA
3
5044
by: RSB | last post by:
Hi Everyone, I have this TextBox with the TextMode="MultiLine". so now it does not validate the text in the TextBox for the MaxLength SO i have decided to execute a CustomValidator for this Textbox and run a CLientSideFunction. now i was making this clientsidefunction generic so that i can validate all the other textboxes also. Now to do this i need the access to the MaxLength Property, which i am not able to read in the Java...
10
3657
by: danthman | last post by:
I have a TextBox set up as follows: <asp:TextBox ID="SubjectTextBox" TextMode="MultiLine" MaxLength="100" Columns="50" Rows="2" Wrap="true" runat="server" />
3
4853
by: h | last post by:
Hi, I have set my textbox's maxlength property to 1 , however it allow more than one word. Is there any settings that I am missing ? Thanks in advance Hardik Shah
1
1920
by: Mel | last post by:
Anyone know how I would retrieve the MaxLength property of a column in my Access Database table? I know how to retrieve table data, for example the "Quote #" field in my example code below, but I have never attempted to access a property of a field. 'Beginning of my Code Example Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\support\webbmq.mdb;" Dim strSel As String = "SELECT * FROM " Dim conWebOrdNum As New...
3
3043
by: engineer | last post by:
Hi, I'm trying to control the maxlength property of a textbox in javascript. But it's not going into effect.This is my code HTML <input type=text id="txt_search_string" class=formtext maxlength=100 /> JavaScript if(var_selection = 'C') document.getElementById('txt_search_string').MaxLength = '6' ;
0
8348
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8779
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8549
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5660
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4186
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2765
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2004
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.