CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> General/Other

 Client Side Hide/Show

Print topic Send  topic

Author Message
laneoc

Posts: 143
Posted: 09/05/2016, 3:09 PM

I'm struggling to get something to work as I'd like it to work.

Based on the user selection from a listbox, I want field prompts in two other components to hide or show. The idea is this:
.
- User makes selection from listbox
- Client side does database lookup based on that selection
- If lookup value = Y, make filed #2 and #3 shown. Else hide.

I have experimented with the CCS Examples but have not had any success whatsoever. (Update Panel, etc.)

Any tips or suggestions?
_________________
Lane
View profile  Send private message
clickryan


Posts: 31
Posted: 09/05/2016, 6:16 PM

just use jquery together with codecharge ;-)
_________________
Codecharge Developer (PHP, ASP.net - C# or VB.net)
for help or inquiries please visit clickryan.com
View profile  Send private message
Oper


Posts: 1181
Posted: 09/06/2016, 4:15 AM

What he said. ..
Use jquery. Really basic. In case need to handle default value or null based on selection then that's part inside of the code
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message
MichaelMcDonald

Posts: 638
Posted: 09/06/2016, 3:42 PM

<script type="text/javascript">
$().ready(function() {
$("#jobnumberid1").hide();
$("#recordtimesheetlineitemjobnumberid").change(function(){
var jobnumberid = $("#recordtimesheetlineitemjobnumberid").find('option:selected').val();
if(jobnumberid == 67 || jobnumberid == 73 || jobnumberid == 388){
$("#jobnumberid1").show();
}
if(jobnumberid != 67 && jobnumberid != 73 && jobnumberid != 388){
$("#jobnumberid1").hide();
}
});
});
</script>
_________________
Central Coast, NSW, Australia.

View profile  Send private message
MichaelMcDonald

Posts: 638
Posted: 09/06/2016, 5:06 PM

I forgot to mention, if problems with multiple calls to this in Update panels ....

use the actual listbox for a standard JS on change i.e. id="listbox" onchange="hideshow();"

and remove "$().ready(function() {", and the closing " });" from the script and wrap it all into a mixed JS / JQuery function:

<script type="text/javascript">
function hideshow() {
$("#jobnumberid1").hide();
$("#recordtimesheetlineitemjobnumberid").change(function(){
var jobnumberid = $("#recordtimesheetlineitemjobnumberid").find('option:selected').val();
if(jobnumberid == 67 || jobnumberid == 73 || jobnumberid == 388){
$("#jobnumberid1").show();
}
if(jobnumberid != 67 && jobnumberid != 73 && jobnumberid != 388){
$("#jobnumberid1").hide();
}
});
}
</script>

It's also fun to use a hidden button and trigger click it to refresh an update panel !
_________________
Central Coast, NSW, Australia.

View profile  Send private message
Waspman

Posts: 946
Posted: 09/28/2016, 3:00 AM

You could use url parameters to set the value of a label i.e. if (CCGetFromGet("id")==Y){$Container->Label->SetValue("style='display:blank'");
_________________
http://www.waspmedia.co.uk
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by UltraApps.com  and YesSoftware, Inc.