Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / August 2005

Tip: Looking for answers? Try searching our database.

How to capture datevalue?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
G.N.Rajesh - 19 May 2005 11:58 GMT
Hi all,

We are trying to capture the date value of a datepicker control which is
placed on an Infopath form into a variable through javascript.
We are not able to capture the value.

we are using the method like:

var datevalue = XDocument.DOM.SelectsingleNode(..path). text;

it is showing javascript error.

Could you please help us on this?

:D

Rajesh
Nic Roche - 19 May 2005 13:39 GMT
> it is showing javascript error.

Whats the error?

Nic Roche

> Hi all,
>
[quoted text clipped - 13 lines]
>
> Rajesh
Scott L. Heim [MSFT] - 19 May 2005 14:02 GMT
Hi,

Here is sample jscript code that works in a sample where I simply placed
the Date Picker control on a new, blank form:

function CTRL2_5::OnClick(eventObj)
{
    var myDateVal = "";
    var myDate = XDocument.DOM.selectSingleNode("//my:myFields/my:field1");
    myDateVal = myDate.text;
    XDocument.UI.Alert(myDateVal);
}

I hope this helps!

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
MatsonPP - 19 May 2005 14:13 GMT
You can also just go

var myDate = XDocument.DOM.selectSingleNode("//my:field1");
G.N.Rajesh - 20 May 2005 09:27 GMT
Hi Scott,

  This coding is working fine when i placed date picker out of repeting
table.But my requirment is i should capture a date picker value from repeting
table. when i placed the date picker inside the repeting table it shows error
message like this

"Object Required"

 you have any suggestion for this.  
Signature

Rajesh

> Hi,
>
[quoted text clipped - 15 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
Scott L. Heim [MSFT] - 20 May 2005 13:38 GMT
Hi Rajesh,

That information helps - the problem you are running into is determining
exactly what row you want to return. Do you have the ability to add another
column in the repeating table and place a button in that column? In this
manner, each row would have an associated button and you could easily get
the value of the row you are on by using code like the following:

function CTRL5_5::OnClick(eventObj)
{
    var dateVal = eventObj.Source.selectSingleNode("my:field1").text;
    XDocument.UI.Alert(dateVal);
}

In this case, my "field1" is the Date Picker control in the first column of
my repeating table.

Let us know if this is a viable solution!

Best Regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights
Martyn Lawson - 11 Aug 2005 17:10 GMT
Hi,

Thanks for this post it saved me a lot of trouble. However, i now have more
trouble. Using the solution below only appears to find the date value from
the first row in the repeating table. How do i find subsequent rows in the
code?

Cheers,
Martyn...

> Hi Rajesh,
>
[quoted text clipped - 21 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.