<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Validate text field</title><link>https://www.infopathdev.com:443/forums/thread/49785.aspx</link><pubDate>Tue, 08 Dec 2009 13:07:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:49785</guid><dc:creator>Svetoslav</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/49785.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=49785</wfw:commentRss><description>&lt;p&gt;Hi Jimmy, &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have similar proble, I have a text field in a section which has some conditional formatting. Since the form is opened from another form, this field is automatically populated. But this action was introduced somehow later&amp;nbsp;so in some of the forms the field is empty. It is very confusing because when the field is full or was full and I delete the information it works just perfect, but if the field hasnt contained any info, it showes me error object required. I am prety sure that the XPath is correct. I see no point in this problem. Do you have any idea where it can come from ? &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards, &lt;/p&gt;
&lt;p&gt;S. Z. &lt;/p&gt;</description></item><item><title>Re: Validate text field</title><link>https://www.infopathdev.com:443/forums/thread/33627.aspx</link><pubDate>Wed, 29 Oct 2008 09:23:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33627</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33627.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33627</wfw:commentRss><description>&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Hi,&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;Use the following code.&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;function CTRL2::OnClick(eventObj)&lt;br /&gt;{&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;if (XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:EnteredBy&amp;quot;) != null)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;var Enteredby = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:EnteredBy&amp;quot;).text; &lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if (parseInt(Enteredby, 10) == &amp;#39;&amp;#39;)&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;XDocument.UI.Alert(&amp;quot;Invalid ID 2.&amp;nbsp; Please try again.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;return&lt;br /&gt;&amp;nbsp;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;}&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/span&gt;}&lt;br /&gt;}&lt;span style="COLOR:black;mso-themecolor:text1;"&gt;&lt;/span&gt;&lt;/span&gt; 
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Validate text field</title><link>https://www.infopathdev.com:443/forums/thread/33558.aspx</link><pubDate>Tue, 28 Oct 2008 04:07:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33558</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33558.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33558</wfw:commentRss><description>&lt;p&gt;Your &lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;var Enteredby = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:EnteredBy&amp;quot;).text;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;line looks ok, but you will get that &amp;quot;object required&amp;quot; error if you reference a node that does not exist (e.g. it is in an optional section that is not included at the time) or if the XPath is misspelled, and that includes case.&amp;nbsp; Please make sure that the node is actually called EnteredBy and not enteredBy or Enteredby.&lt;/p&gt;
&lt;p&gt;There is definitely a problem with this line:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if(parseInt(Enteredby, 10) = &amp;quot;&amp;quot;){&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;if you want to compare two values you need to use the == operator, not =, but in this case, you should be using&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;if(isNaN(parseInt(Enteredby, 10)){&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;to check whether Enteredby is a valid number or not.&lt;/p&gt;</description></item><item><title>Validate text field</title><link>https://www.infopathdev.com:443/forums/thread/33555.aspx</link><pubDate>Mon, 27 Oct 2008 22:55:35 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33555</guid><dc:creator>dharmendrapau</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33555.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33555</wfw:commentRss><description>&lt;p&gt;//&amp;lt;namespacesDefinition&amp;gt;&lt;br /&gt;XDocument.DOM.setProperty(&amp;quot;SelectionNamespaces&amp;quot;, &amp;#39;xmlns:xsi=&amp;quot;&lt;a href="http://www.w3.org/2001/XMLSchema-instance"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&amp;quot; xmlns:q=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/queryFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/queryFields&lt;/a&gt;&amp;quot; xmlns:d=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/ado/dataFields"&gt;http://schemas.microsoft.com/office/infopath/2003/ado/dataFields&lt;/a&gt;&amp;quot; xmlns:dfs=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution"&gt;http://schemas.microsoft.com/office/infopath/2003/dataFormSolution&lt;/a&gt;&amp;quot; xmlns:my=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-04-28T23:32:58"&gt;http://schemas.microsoft.com/office/infopath/2003/myXSD/2008-04-28T23:32:58&lt;/a&gt;&amp;quot; xmlns:xd=&amp;quot;&lt;a href="http://schemas.microsoft.com/office/infopath/2003&amp;quot;&amp;#39;"&gt;http://schemas.microsoft.com/office/infopath/2003&amp;quot;&amp;#39;&lt;/a&gt;);&lt;br /&gt;//&amp;lt;/namespacesDefinition&amp;gt;&lt;/p&gt;
&lt;p&gt;function CTRL2::OnClick(eventObj)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;var Enteredby = XDocument.DOM.selectSingleNode(&amp;quot;/my:myFields/my:EnteredBy&amp;quot;).text; &lt;strong&gt;&lt;em&gt;(Error message appears here, saying object required)&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;if (parseInt(Enteredby, 10) = &amp;quot;&amp;quot;){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;XDocument.UI.Alert(&amp;quot;Invalid ID 2.&amp;nbsp; Please try again.&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&lt;br /&gt;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;How can I overcome this issue???&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>