Wrox Programmer Forums
|
BOOK: Beginning InfoPath 2003
This is the forum to discuss the Wrox book Beginning InfoPath 2003 by F. Scott Barker; ISBN: 9780764579486
ISBN: 0-7645-7948-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning InfoPath 2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2014, 07:14 AM
Registered User
 
Join Date: Mar 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12 Try it out

The Try it out in Chapter 12 was to write code to put 2 names together using infopath jscript

Basically two boxes with first name and surname then below two boxes would combine the first box was surname comma first name and the second box was firstname space surname

The code in jscript is

function createFullName()
{
var firstnameField = XDocument.DOM.selectSingleNode("//my:txtFirstName");
var lastnameField = XDocument.DOM.selectSingleNode("//my:txtLastName");
var lastfirstwithcommaField = XDocument.DOM.selectSingleNode("//my:txtLastFirstWithComma");
var fullnameField = XDocument.DOM.selectSingleNode("//my:txtFullName");

if ((firstnameField.text.length>0) && (lastnameField.text.length>0))

lastfirstwithcommaField.text=lastnameField.text + ', ' +
firstnameField.text;

fullnameField.text=firstnameField.text + ' ' + lastnameField.text
}

Has anyone written this code using vbscript?

Also the book writes code in jscript is it better to code in jscript than vbscript in infopath

Let me know

Thanks
Richard





Similar Threads
Thread Thread Starter Forum Replies Last Post
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM
Chapter 12 .MAttButler BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 5 September 10th, 2006 08:31 PM
Errors on Chapter 12 example(12.8) sonnie ASP.NET 2.0 Professional 2 June 7th, 2006 10:55 AM
Chapter 12 Koga VB.NET 2002/2003 Basics 0 November 2nd, 2004 11:43 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.