Expand my Community achievements bar.

SOLVED

Beginner help - If statements?

Avatar

Level 2

Hi Guys,

I am new to creating forms. I am trying to make my business more electronic and professional by getting my mechanics to use pdf forms to complete service sheets (we are in the truck repair business).

I have attached the sheet that I am trying to convert to a form. Where I need some help, is I have a drop down list with all my mechanics names (the list is viewable on screen only, not print). Names are format of First and Last. Prior to completing the checklist of items, the mechanic needs to fill out the top of the form.

You can see that I have made a checkbox, drop down, and "read only" beside "Instruments and Gadgets". How I would like this to function, is the mechanic will check the checkbox if the item is "okay". Following him clicking the checkbox, I would like the "read only" textbox to populate his initials under "I.D". For instance, if Chris Antolick was selected as the mechanic in the big drop down box, and Chris checks off "Instruments and Gadgets", I would like CA to populate the read only box on that line. I would also like that same box to populate with his initials if he makes a selection from the dropdown list beside the checkbox instead of the checkbox (for instance, if he selects "X - Needs Repair", then his initials will populate the read only box).

I would also like to have the mechanics initials immediately show up at the bottom of page 2 in the read only box that sits on the "Initials" line as soon as the mechanic is selected from the drop down box on the top of page 1.

I am more used to the Microsoft Access forms and I would have used if statements to do this here, but I don't think these are remotely close same language?

I understand this is probably some tricky coding, but if anyone could help me out on this one that would be very, very much appreciated.

The form can be found here: http://motorcyclesaddlebags.bravehost.com/form1.pdf

Thank you!!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Plesae find attached a modified version of your form. I adjusted your Mechanic DDList to display the proper name of the mechanic but use the initials as the reported value. See the binding tab of the Mechanic DDList. I also added code to the Checkbox and the Code List to populate the ID field with the proper value. The fact tthat you had the Technician field and the mechanic field set as global binding made the reported value appear automatically. You will run out of room in the Code column to put a DD and a checkbox ...so I added the OK option to the DD in the second line to show you how that might work.

Let me know what you think .....if you want me to remove your form from this post just let meknow and I will.

Paul

View solution in original post

6 Replies

Avatar

Correct answer by
Former Community Member

Plesae find attached a modified version of your form. I adjusted your Mechanic DDList to display the proper name of the mechanic but use the initials as the reported value. See the binding tab of the Mechanic DDList. I also added code to the Checkbox and the Code List to populate the ID field with the proper value. The fact tthat you had the Technician field and the mechanic field set as global binding made the reported value appear automatically. You will run out of room in the Code column to put a DD and a checkbox ...so I added the OK option to the DD in the second line to show you how that might work.

Let me know what you think .....if you want me to remove your form from this post just let meknow and I will.

Paul

Avatar

Level 2

Paul,

This is awesome, thank you so much for helping with this. Only thing, let's say my mechanic is filling the sheet out, and he accidentally clicks a checkbox. His initials will be placed in the second box, but when he unchecks the box, they remain (same if he uses the drop down box). Is there anyway to fix that? Maybe we should have a " " option in the drop down , so "A", "X" and " ", the " " being the selection if he wants nothing in the box, it could be the default.

Also, on the bottom of the second page, could the initials be in the "ID" line, and then the mechanics full name under "technician"?

Thanks a bunch, my mechanics are going to LOVE this!!

Avatar

Former Community Member

Ok Here is

round 2 .....I renamed the field at the bottom of page 2, changed the binding so that it is not global then added code to the exit event of the Mechanic

DD to populate that field with the display value that is selected.

Also added an else clause to the checkbox code so that if you uncheck then the ID field will clear.

Also note that if they do not choose their ame in the mechanic field then the ID field will not populate when they select ...we could check to make sure that they have chosen a name before allowing a change. I added this code and move the code from the change event to the exit event ....let me know what you think.

Paul

Avatar

Level 2

Awesome, EXACTLY the help I needed. This is perfect. Thanks a bunch for all your help!!  You're the man!

PS if you don't mind, could you take down my form for me

Avatar

Level 2

Oops, one thing I'd like to ask you. Is there a setting that can be on in this form such that info can not be saved (ie: the form opens fresh, with all input fields blank)? Right not if I close, it asks me to save changes...if I save changes, the form opens with everything filled in.

Avatar

Former Community Member

Ok the modified forms have been removed .....

Just save it under a different name ...that way you can can always go back the original blank one and your users can save partially saved forms.

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----