Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 2024 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: Show/Hide text box based on content of Lookup box
Darren Savery
Posts: 51
 
Show/Hide text box based on content of Lookup boxYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jul 06 10:48 AM
fiogf49gjkf0d
Hi,

I have edited the 'Insert Opportunity' form and added 2 new fields : one is a LookupEdit and one is a text box. Basically, I have a 'source' field (the lookup) and then a free text box allowing the user to say exactly what the source of the lead was.

I want the text box to be hidden by default and only appear when someone populates the lookup box.

The code I tried is this :

Sub lveSourceClick(Sender)
If lveSource.Lookup = "" Then Exit Sub

If lveSource.Lookup <> "" then
txtSourceEvent.Visible = True
lblSourceEvent.Visible = True
Else
txtSourceEvent.Visible = False
lblSourceEvent.Visible = False
End If

End Sub

I cannot get this to work.

Can anyone help?
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Show/Hide text box based on content of Lookup boxYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jul 06 11:09 AM
fiogf49gjkf0d
Are you sure you have the script wired to an event?

Try putting a MsgBox statement in the script to see if it is firing when you expect. BTW, I usually do these type of things on the WhenExit event.
[Reply][Quote]
Doug Miller
Posts: 20
 
Re: Show/Hide text box based on content of Lookup boxYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jul 06 11:20 AM
fiogf49gjkf0d
Quote:
Originally posted by Darren Savery

Hi,

I have edited the 'Insert Opportunity' form and added 2 new fields : one is a LookupEdit and one is a text box. Basically, I have a 'source' field (the lookup) and then a free text box allowing the user to say exactly what the source of the lead was.

I want the text box to be hidden by default and only appear when someone populates the lookup box.

The code I tried is this :

Sub lveSourceClick(Sender)
If lveSource.Lookup = "" Then Exit Sub

If lveSource.Lookup <> "" then
txtSourceEvent.Visible = True
lblSourceEvent.Visible = True
Else
txtSourceEvent.Visible = False
lblSourceEvent.Visible = False
End If

End Sub

I cannot get this to work.

Can anyone help?


Try using lveSource.Lookupid or lveSource.Text to see if there is something populated.
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: Show/Hide text box based on content of Lookup boxYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Jul 06 12:06 PM
fiogf49gjkf0d
Quote:
Originally posted by Darren Savery

Hi,

I have edited the 'Insert Opportunity' form and added 2 new fields : one is a LookupEdit and one is a text box. Basically, I have a 'source' field (the lookup) and then a free text box allowing the user to say exactly what the source of the lead was.

I want the text box to be hidden by default and only appear when someone populates the lookup box.

The code I tried is this :

Sub lveSourceClick(Sender)
If lveSource.Lookup = "" Then Exit Sub

If lveSource.Lookup <> "" then
txtSourceEvent.Visible = True
lblSourceEvent.Visible = True
Else
txtSourceEvent.Visible = False
lblSourceEvent.Visible = False
End If

End Sub

I cannot get this to work.

Can anyone help?



Try this on the Change Event
Sub lveSourceChange(Sender)

If lveSource.Text <> "" then
txtSourceEvent.Visible = True
lblSourceEvent.Visible = True
Else
txtSourceEvent.Visible = False
lblSourceEvent.Visible = False
End If

End Sub

[Reply][Quote]
Darren Savery
Posts: 51
 
Re: Show/Hide text box based on content of Lookup boxYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 25 Jul 06 9:53 AM
fiogf49gjkf0d
Many thanks guys. I've managed to get it working. However, I have stumbled on to my next newbie challenge. I've posted it in a new thread if anyone is interested in having a look.

Darren
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/22/2024 7:50:47 PM