VbScript to clear default value onload of submitted Form - InfoPath Dev
in

InfoPath Dev

VbScript to clear default value onload of submitted Form

Last post 10-22-2008 09:16 PM by Shiva. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-22-2008 09:05 AM

    VbScript to clear default value onload of submitted Form

    Hello,

    I have an InfoPath 2003 form that opens up a resource file.  I have a field that connects to that resource file and provides 3 options: 1)Optional - Please Select 2) Install 3) Do Not install.  The default value on the Data Source is essentially 'XMLField3' where XMLField=InfoPathField and where XMLField2=InfoPathField2.

    The user selects either Install or Do Not install and submits the form.  When the user opens up the form to view it after submitting, the value of the infopath field reverts back to Optional-Please Select because of the default value. 

    Here is what I want to accomplish - create a vbscript that says if the Form is not new, set the Default Value to blank.  This should in turn keep the submitted value.  Any thoughts?  Thanks!

  • 10-22-2008 09:16 PM In reply to

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

    Re: VbScript to clear default value onload of submitted Form

    Hello,

    In onLoad function you have to write the below code,

    if(!XDocument.IsNew)

    {

    XDocument.DOM.selectSingleNode("<XPath of the drop down field").text = "";

    }

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