using check box to automatically input text - InfoPath Dev Sign in | Join | Help in Newbie Questions InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Newbie Questions » using check box to automatically input text Use our Google Custom Search for best site search results. using check box to automatically input text Last post 12-29-2008 12:23 PM by fallaway. 11 replies. Page 1 of 1 (12 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 12-02-2008 07:20 AM bill_fmi Joined on 11-24-2008 Posts 13 using check box to automatically input text Reply Contact I am wondering if there is a way that once a user selects a check box, I can have the data it is representing input with a time/date/username stamp in the rich text box that is read only? 12-02-2008 08:09 AM In reply to jrudolph Joined on 07-02-2008 Orlando, FL Posts 67 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Use a rule on the check box that is triggered by the check. Ex: When Check Box Condition = True Add Action: Set Rich Text Box Default Field Value to " concat(now(), today(), userName()) " format accordingly. Hope this helps. 12-02-2008 09:33 AM In reply to Anuma Joined on 07-20-2005 India Posts 525 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Hi, If we add the Now() and Today() functions, then date will be displayed two times. Try this. concat(now(), " ", userName()) or concat(substring-after(now(), "T"), today(), userName()) Anuma Chinthapalli /http://www.GGKTech.com 12-02-2008 09:40 AM In reply to jrudolph Joined on 07-02-2008 Orlando, FL Posts 67 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Yes this is true, thanks Anuma. Also remember as Anuma has displayed above, feel free to use " " or " _ " or any variation similar to Excel formuals to seperate the fields as much as you want. 12-02-2008 09:59 AM In reply to bill_fmi Joined on 11-24-2008 Posts 13 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Here is what I am trying to use but I know I am doing something wrong with the syntax. Sorry I am just learning all of this. substring-after(now(), "T"), " ", userName(), DAY_TEXT_1.0 What I am wanting to see is when a user checks the box I get Time (MILITARY) Username What ever was in the text box that they checked. We I trying to ad some you uniformity and accountability to our NOC and this will be a Daily Turnover & Duties log 12-02-2008 10:09 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,293 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact You are missing the concat: concat(substring-after(now(), "T"), " ", userName(), DAY_TEXT_1.0) Hilary Stoupa 12-02-2008 10:28 AM In reply to bill_fmi Joined on 11-24-2008 Posts 13 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact its always the darn cat; I thought something looked amiss, that is working, thank you! next question is There are about 10 Check boxes is there formula to add to what we have now so that it will start a new line in the Rich Text Box, Also and less important than the above is there a way to make the text box default to using bullets? 12-02-2008 12:02 PM In reply to jrudolph Joined on 07-02-2008 Orlando, FL Posts 67 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact On the first part of your question. I dont think this can be done without using managed code or without creating a ton of rules that have different combinations of the items you want displayed. Another option since you are using a "Read Only" text box anyways is to create a "section" and make the border of the section be a thin line, to emulate what a rich text box would look like. Then create 10 Text boxes with the default values set to what you desire inside of them. This method might allow you to add the bullet with some formatting. Then make it so that the text boxes are hidden unless the check mark is = True, using conditional formating. This method is probably better only if you are not extracting the data for use else where. I may be wrong and would like to know if anyone else has a better way of doing it myself. Hope this helps. 12-03-2008 08:28 AM In reply to bill_fmi Joined on 11-24-2008 Posts 13 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Thanks for the help and info, we decided not to go with this option. 12-29-2008 11:00 AM In reply to fallaway Joined on 12-29-2008 Posts 2 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact When I try those formulas, I get the error: --- 'username' is not a valid XSLT or XPath function. concat(substring-after(xdDate:Now(), "T"), " ", xdDate:Today(), -->username()<--) --- Is this because I'm using InfoPath 2003? TIA! 12-29-2008 12:14 PM In reply to warrtalon Joined on 12-14-2007 Denver, CO Posts 980 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Yes, that is not a function in IP2003. Also, it's userName() (in IP2007). Instead of typing things out manually, it's best to choose the function in the wizard so that you don't make any syntax mistakes at least until you master it. Clayton Cobb || SharePoint MVP || Clayton's SharePoint MadnessPlanet Technologies || Federal Partner of the Year (2005-2010) || SLG Partner of the Year (2010) 12-29-2008 12:23 PM In reply to fallaway Joined on 12-29-2008 Posts 2 Re: using check box to automatically input text Mark as Not AnswerMark as Answer... Reply Contact Thanks for the quick reply - and darn, so much for that nice easy solution. Is there another way to pull a user's name? I want to record the user and date/time when they check a box, and this would be for about 6 check boxes, each potentially with a different user checking them. The list of functions is quite limited! Page 1 of 1 (12 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Use our Google Custom Search for best site search results.
I am wondering if there is a way that once a user selects a check box, I can have the data it is representing input with a time/date/username stamp in the rich text box that is read only?
Use a rule on the check box that is triggered by the check.
Ex: When Check Box Condition = True
Add Action:
Set Rich Text Box Default Field Value to " concat(now(), today(), userName()) " format accordingly.
Hope this helps.
Hi,
If we add the Now() and Today() functions, then date will be displayed two times.
Try this.
concat(now(), " ", userName())
or
concat(substring-after(now(), "T"), today(), userName())
Yes this is true, thanks Anuma.
Also remember as Anuma has displayed above, feel free to use " " or " _ " or any variation similar to Excel formuals to seperate the fields as much as you want.
Here is what I am trying to use but I know I am doing something wrong with the syntax. Sorry I am just learning all of this.
substring-after(now(), "T"), " ", userName(), DAY_TEXT_1.0
What I am wanting to see is when a user checks the box I get Time (MILITARY) Username What ever was in the text box that they checked. We I trying to ad some you uniformity and accountability to our NOC and this will be a Daily Turnover & Duties log
You are missing the concat:
concat(substring-after(now(), "T"), " ", userName(), DAY_TEXT_1.0)
its always the darn cat; I thought something looked amiss, that is working, thank you! next question is There are about 10 Check boxes is there formula to add to what we have now so that it will start a new line in the Rich Text Box,
Also and less important than the above is there a way to make the text box default to using bullets?
On the first part of your question. I dont think this can be done without using managed code or without creating a ton of rules that have different combinations of the items you want displayed.
Another option since you are using a "Read Only" text box anyways is to create a "section" and make the border of the section be a thin line, to emulate what a rich text box would look like. Then create 10 Text boxes with the default values set to what you desire inside of them. This method might allow you to add the bullet with some formatting. Then make it so that the text boxes are hidden unless the check mark is = True, using conditional formating. This method is probably better only if you are not extracting the data for use else where.
I may be wrong and would like to know if anyone else has a better way of doing it myself.
Thanks for the help and info, we decided not to go with this option.
When I try those formulas, I get the error:
---
'username' is not a valid XSLT or XPath function.
concat(substring-after(xdDate:Now(), "T"), " ", xdDate:Today(), -->username()<--)
Is this because I'm using InfoPath 2003? TIA!
Yes, that is not a function in IP2003. Also, it's userName() (in IP2007). Instead of typing things out manually, it's best to choose the function in the wizard so that you don't make any syntax mistakes at least until you master it.
Thanks for the quick reply - and darn, so much for that nice easy solution. Is there another way to pull a user's name? I want to record the user and date/time when they check a box, and this would be for about 6 check boxes, each potentially with a different user checking them.
The list of functions is quite limited!