Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > BOOK: JavaScript 24-Hour Trainer
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: JavaScript 24-Hour Trainer
This is the forum to discuss the Wrox book JavaScript 24-Hour Trainer Jeremy McPeak; ISBN: 978-0-470-64783-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: JavaScript 24-Hour Trainer section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 18th, 2014, 10:22 AM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Symform Symforms - can you believe: ...

... there is no! other! post! in the entire site of p2p.wrox.com forums that contains the word symform , or symforms ? You read it here first!! Am I earning my pay or what?

Well: symforms enhanced with javascript are what I am working on.

Suppose we have a PDF document, enhanced via symforms to be somewhat interactive. So there are a bunch of symform fields embedded in the PDF document, and let's say that two of them are:

F01 ... the text of a customer's name, and
F25 ... a checkbox

Now, this scenario may seem whimsical, but it does cover what I am trying to do. The goal is to add javascript such that:

(a) if and when F25 is "checked", the text "F25 checked!" will get stomped into F01, _but_

(b) that happens _only_ if F01 is non-blank _and_ the first two characters of the name in F01 are not "Ch".

Here are a few clues from what has worked so far to do other things. Below is a function, named F259sez, that:

-- detects whether field F259 - which is a checkbox - has been checked or not,
-- loads array F with the names of nine other fields, and then
-- uses a biiiiig, already-built-in function (not written by me, but which I could post if anyone wants it) which is accessed as "sympdf.hideShow()" , to make those nine other fields non-interactive _if_ F259 got checked.

function F259sez()
{
var F259ch = this.getField("F259").value == "Off";
var F=new Array();

F[0]="F260";
F[1]="F261";
F[2]="F262";
F[3]="F263";
F[4]="F264";
F[5]="F265";
F[6]="F266";
F[7]="F267";
F[8]="F268";

sympdf.hideShow(F259ch,F);
}

You may be asking, "Ummmm, how might this help me to answer this question?" Well, the above function does show ...

... how we access the value of an embedded field (albeit that field was a checkbox, not a string of text), and

... how we, generally, refer to the names of the embedded fields.

P.S. If you are foxy, you may be looking at this:

var F259ch = this.getField("F259").value == "Off";

... and saying to yourself, "Hey ... if all that is supposed to happen when the checkbox is *checked*, shouldn't that oughta be != instead of == ?" And I would agree. But, the way thet thar sympdf.hideShow() is written , the above code is how it works correctly.

Thank you for your time!

Last edited by howdowelearntocovet; June 18th, 2014 at 01:19 PM. Reason: typo: an -> a
Reply With Quote
  #2 (permalink)  
Old June 18th, 2014, 04:32 PM
Registered User
Points: 13, Level: 1
Points: 13, Level: 1 Points: 13, Level: 1 Points: 13, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2014
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default The question has been answered

No one needs to work on it now, thank you.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off



All times are GMT -4. The time now is 04:50 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.