Textbox Shading controls - InfoPath Dev
in

InfoPath Dev

Textbox Shading controls

Last post 09-04-2008 08:35 AM by [email protected]. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-24-2007 12:07 AM

    • Sunny
    • Not Ranked
    • Joined on 08-17-2007
    • Posts 7

    Textbox Shading controls

    Is there a way of shading the textbox to a certain color if it has the focus

    meaning, I want the text box to change color as soon as someone clicks on it to highlight the fact that thats where the cursor is currently.

     And when another text box is clicked then that should be shaded and the last one's shading should disappear.

     Any ideas?

     Thanks in advance.

  • 08-24-2007 03:14 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Textbox Shading controls

    Hi Sunny Welcome to the Forums,

    It is little bit complicated to shading the text box color when focus is on that filed. But we can it by using code.

    You have to add new node(FocusFieldName) in secondary dom. You have to write the below code in OnContextChange event.

    string nodeName = e.Context.nodeName;

    secondaryDOM.selectSingleNode("Node Path of your focus field name", nodeName).text = nodeName;

    This function executes when ever context is changed any selection or any focus is changes in the form. For every time we will set the focus field name in your ‘FocusFieldName’ node. Add condition formatting to each and every field to change the field color when focus is changed.

    Condition should be like:

    //Left side name of selected field and right side whichever we set the focus field name.

    name(my:BriefNumber) = secondaryDOM.selectSingleNode("Node Path of your focus field name") .text;

    Hope this helps you

  • 08-26-2007 05:19 PM In reply to

    • Sunny
    • Not Ranked
    • Joined on 08-17-2007
    • Posts 7

    Re: Textbox Shading controls

    Hi Shiva,

     Thank you very much for that. It worked great!

     Cheers

  • 09-04-2008 08:35 AM In reply to

    Re: Textbox Shading controls

    Hi

    I am working on a similar issue in infopath 2007, the form is browser enabled.

    Could you please suggest a way to accomplish the same behaviour in browser enabled infopath form?

     

    Thanks

     

    Lakshmi
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.