HManney
Posts: 6
|
| Posted: 08/25/2008, 5:24 PM |
|
Hello all,
I have a listbox that contains referrals, e.g. Monster, Dice, Newspaper, Employee, etc. If the user selects Employee then I need to display an additional field on the form so they can type in the employee's name.
Can anyone enlighten me with sample code and demonstrate how to test for a specific value?
Many thanks!
_________________
Regards,
Henry Manney |
 |
 |
maxhugen
Posts: 272
|
| Posted: 08/26/2008, 5:43 AM |
|
G'day Henry
Maybe you could wrap the field 'employee' in a div, and make it hidden to begin with, eg:
<div id="ShowEmployee" style="display:hidden"><input id="MyForm_employee_id" value="{employee_id}" name="{employee_id_Name}"></div>
Then, add a Client-side 'On Change' event to the listbox. This inserts a 'custom code' javascript function. In the function, check the value of the referrals listbox, and if it's 'Employee', set the div 'ShowEmployee' to display="" (ie, visible).
You'd probably also have to have a js function when the page opens, that displays the ShowEmployee div if it's already set to referral=Employee.
HTH
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/26/2008, 2:31 PM |
|
Goto Listbox properties, OnClick Client Side Event, Add Action, choose the
Validate minimum value action, in there you put the numeric value of your listbox General.
Fill out the Actions fields, then swith to HTML and see the validation code.
Study it, then through Events remove the Validation, and add your own code.
Is a way I often use to get nearer to the problem ( I mean solution).
But, knowing our fellow members here, by the time you have that figures out someone offers the solution.
That is faster, but the first is better, lol.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|