<?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: keeping focus on field after rule</title><link>https://www.infopathdev.com:443/forums/thread/14551.aspx</link><pubDate>Wed, 25 Oct 2006 07:19:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14551</guid><dc:creator>zaphi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14551.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14551</wfw:commentRss><description>Hi Agni&lt;br /&gt;Thanks a lot. Now it's correct.&lt;br /&gt;&lt;br /&gt;Best regards.&lt;br /&gt;Philippe</description></item><item><title>Re: keeping focus on field after rule</title><link>https://www.infopathdev.com:443/forums/thread/14550.aspx</link><pubDate>Mon, 23 Oct 2006 20:57:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14550</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14550.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14550</wfw:commentRss><description>Hi Zaphi,&lt;br /&gt;The following code should work for you.&lt;br /&gt;var objField1 = XDocument.DOM.selectSingleNode("//my:myFields/my:field1"); //Get the node&lt;br /&gt;XDocument.View.SelectText(objField1); //SelectText method takes the focus to "field1".&lt;br /&gt;</description></item><item><title>Re: keeping focus on field after rule</title><link>https://www.infopathdev.com:443/forums/thread/14549.aspx</link><pubDate>Thu, 19 Oct 2006 12:57:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14549</guid><dc:creator>zaphi</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14549.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14549</wfw:commentRss><description>Hi,&lt;br /&gt;I have the similar requirement and I tried it as explained. But I receive an error, that the method focus()not supported by the object (node).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Does anybody can help me?&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;best regards.&lt;br /&gt;Philippe&lt;br /&gt;</description></item><item><title>Re: keeping focus on field after rule</title><link>https://www.infopathdev.com:443/forums/thread/14548.aspx</link><pubDate>Thu, 18 May 2006 00:23:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14548</guid><dc:creator>SamDahl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14548.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14548</wfw:commentRss><description>That example was from a html page. Node selection in InfoPath is more like this:&lt;br /&gt;&lt;br /&gt;var objField1 = XDocument.DOM.selectSingleNode("//my:myFields/my:field1");</description></item><item><title>Re: keeping focus on field after rule</title><link>https://www.infopathdev.com:443/forums/thread/14547.aspx</link><pubDate>Thu, 18 May 2006 00:10:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14547</guid><dc:creator>SamDahl</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14547.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14547</wfw:commentRss><description>Here's a small sample, basically you need to know which node you want and use the .focus() method.&lt;br /&gt;&lt;br /&gt;function setfocus()&lt;br /&gt;{&lt;br /&gt;var myform = document.forms(0);&lt;br /&gt;var mycntrl = myform.elements(2);&lt;br /&gt;&lt;br /&gt;alert(mycntrl.name); &lt;br /&gt;mycntrl.focus(); &lt;br /&gt;}&lt;br /&gt;</description></item><item><title>keeping focus on field after rule</title><link>https://www.infopathdev.com:443/forums/thread/12866.aspx</link><pubDate>Wed, 17 May 2006 19:17:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12866</guid><dc:creator>cde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12866.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12866</wfw:commentRss><description>This is probably a simple question for the jscript savvy, but I'm new to coding so here goes.&lt;br /&gt;&lt;br /&gt;1. I've got a text box control with the data type set to integer.  The default value is set to 0.&lt;br /&gt;&lt;br /&gt;2. I've assigned a rule to this control that checks the pattern of what the user enters and if it is not an integer, a dialog box will appear with an error message.&lt;br /&gt;&lt;br /&gt;3. After the user closes the error message box, the field is reset to 0 and the cursor then moves to the next field.  This is not what I want to happen. I want the cursor to remain on the field until the user either enters a number or leaves it at the default 0.&lt;br /&gt;&lt;br /&gt;So, I'm guessing that I need to set up an 'OnBeforeChange' or 'OnValidate" event that keeps the focus on the field after the error message is closed.  Can someone point me to any sample jscript that will help me do this?</description></item></channel></rss>