Print Page | Close Window

Drop-downs and List Boxes

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1518
Printed Date: 11 Jul 25 at 4:22AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Drop-downs and List Boxes
Posted By: wrightj
Subject: Drop-downs and List Boxes
Date Posted: 22 Jul 10 at 8:56PM
I can't seem to figure out how to find out what index is selected nor what text is being displayed if the user typed their own selection. How can I find out what is being displayed in a Drop-down list and what item is selected in a List Box.

Drop-Down List Properties:

Field Title: form1[0].#subform[0].DropDownList1[0]
Field Description: Drop-down List
Field Caption:
Field Type: 5
Field Choice Type: 2
Field Value:
Field Value By Title:
Field Default Value:
Field Flags: 67502082

Sub-count = 6, so 6 sub-items

Item 1, Field Sub Name: hello
Item 2, Field Sub Name: no
Item 3, Field Sub Name: yes
Item 4, Field Sub Name: what
Item 5, Field Sub Name: sure
Item 6, Field Sub Name: go

Yes is selected, which would be Index 2 (or 3, depends on the way you look at it). I need to know if QuickPDF library can tell me this.

Any help would be GREATLY appreciated.



Replies:
Posted By: wrightj
Date Posted: 22 Jul 10 at 10:55PM
Ok, I made a little progress. While I haven't been able to find a way to see what was selected from the FormField functions, I was able to see in the GetObjectSource() function.

So for my drop-down list, GetObjectSource for its object number returned:
<<
/F 4
/P 10 0 R
/T (DropDownList1[0])
/V (go)
/AP <<
/N 97 0 R
>>
/DA (/MyriadPro-Regular 10.00 Tf 0 g)
/FT /Ch
/Ff 67502082
/NM (c7fb03b4-cd42-4fcc-80bf275db946258b)
/TU (Drop-down List)
/Opt [ [ (hello) (hello) ] [ (no) (no) ] [ (yes) (yes) ] [ (what) (what) ] [ (sure) (sure) ]
[ (go) (go) ] ]
/Rect [ 127.701 706.323 226.913 726.165 ]
/Type /Annot
/Parent 41 0 R
/Subtype /Widget
/StructParent 2
>>

And obviously /V is my value that is selected (which is correct). Is there an easier way to do this?




Posted By: wrightj
Date Posted: 22 Jul 10 at 10:58PM
One problem with doing it this way:

When a drop-down list contains selectable options but also an empty option where they can type something in and save it, GetObjectSource() DOES NOT have anything for the value.

It shows as:
/V ()

Hopefully there is a way around this.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk