CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 pulling hair out

Print topic Send  topic

Author Message
bas
Posted: 08/02/2008, 1:38 PM

I have 6 fields in my search

Rather than have a seperate search form for Basic and Advance Search

I want only one field (drop list) is to be visible by default

When the user presses Advance Seach button - I want to expand the form and
display the
other five text boxes

I've created a UpdatePanel and moved both Search and Grid into it
But can't seem to get the 5 items to hide

Waspman

Posts: 948
Posted: 08/03/2008, 3:24 AM

So the panel containing the extra fields inside your updateable panel is hidden by default and a session is set when the user clicks something which it turn shows the hidden panel right?

T

_________________
http://www.waspmedia.co.uk
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/03/2008, 6:45 AM

You are using an updatepanel to have the Search and Grid interact instantly.
You need to add another (normal)panel, inside the search, put the five fields on that
and then hide show that panel based on your Advanced Search Button.
I might even substitute the Advanced Search Button by a simple checkbox.

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
View profile  Send private message
bas
Posted: 08/05/2008, 12:05 AM

Still in Thicko mode ....sorry, I'm not getting it ...

To simplify I have started with a NEW Saeach & Grid without the update Panel
Then just added a NORMAL panel
Moved the fields I want for the Advance search on to it and set the panel
Visible to NO
Then on my Advance Search Button OnClick event I have added the code
$equipmentSearch->Panel1->Visible = true;

This should work right??


"wkempees" <wkempees@forum.codecharge> wrote in message
news:54895b67fef073@news.codecharge.com...
> You are using an updatepanel to have the Search and Grid interact
> instantly.
> You need to add another (normal)panel, inside the search, put the five
> fields
> on that
> and then hide show that panel based on your Advanced Search Button.
> I might even substitute the Advanced Search Button by a simple checkbox.
>
> Walter
> _________________
> Origin: NL, Timezone GMT+1 (Forumtime +9)
> CCS3/4.01.006 PhP, MySQL (Vista/XP, XAMPP)
>
> if you liked this info PAYPAL me: http://donate.consultair.eu
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

wkempees


Posts: 1679
Posted: 08/05/2008, 3:31 AM

No, it should not work like that.
You click the button, Custom Code executed, form is submitted.
Upon return, the form does not know about the custom code having set anything.
You want to set a variable that is posted and upon return still is set.

Add a checkbox, call it advanced search initialy unchecked.
Have the user check the box, OnClick Submit
The in the before Show, test if the checkbox is checked and let the panel have its visibility depend on that.

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
View profile  Send private message
bas
Posted: 08/05/2008, 4:49 AM

Already tried that

In panel1 beforeshow I have

if ($equipmentSearch->CheckBox1 == 1) {
$equipmentSearch->Panel1->Visible = true;
} else {
$equipmentSearch->Panel1->Visible = false;
}

CheckBox1 is set to Boolean and Checked value is 1 unchecked and default set
to 0

Also tried

if ($equipmentSearch->CheckBox1 ) {
$equipmentSearch->Panel1->Visible = true;
} else {
$equipmentSearch->Panel1->Visible = false;
}

"wkempees" <wkempees@forum.codecharge> wrote in message
news:548982bf611362@news.codecharge.com...
> No, it should not work like that.
> You click the button, Custom Code executed, form is submitted.
> Upon return, the form does not know about the custom code having set
> anything.
> You want to set a variable that is posted and upon return still is set.
>
> Add a checkbox, call it advanced search initialy unchecked.
> Have the user check the box, OnClick Submit
> The in the before Show, test if the checkbox is checked and let the panel
> have
> its visibility depend on that.
>
> Walter
>
>
>
>
> _________________
> Origin: NL, Timezone GMT+1 (Forumtime +9)
> CCS3/4.01.006 PhP, MySQL (Vista/XP, XAMPP)
>
> if you liked this info PAYPAL me: http://donate.consultair.eu
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

RonB

Posts: 228
Posted: 08/05/2008, 6:51 AM

why not use JavaScript for that? create the form with a div holding the advanced fields and use a hyper link to show or hide the fields? that way you do not need to go back to the server just to show a few fields.

I use this in a form where depending on a choice made in a drop down fileds are visible or not:

function hideMe()  
{  
        if (document.all.apparaat_type.options[apparaat_type.selectedIndex].value=="6")  
        {  
        row1.style.display="";  
                row2.style.display="none";  
                  
                }else {row1.style.display="none";}  
                 if (document.all.apparaat_type.options[apparaat_type.selectedIndex].value=="7")  
        {  
        row1.style.display="none";  
                row2.style.display="";  
          
                }else {row2.style.display="none";}  
}
View profile  Send private message
wkempees


Posts: 1679
Posted: 08/05/2008, 6:57 AM

Quote :
To simplify I have started with a NEW Saerch & Grid without the update Panel
Then just added a NORMAL panel
Moved the fields I want for the Advance search on to it and set the panel
Visible to NO
read the above, then somewhere between the visible search and the invisible panel
add a checkbox, from the Form Toolbox.
Mouseselect the checkbox to see it's properties (defaultname CheckBox1)
Set
ControlSource to CodeExpression
Checked = 1
Unchecked =0
DefaultValue UnChecked
Switch to Checbox's Properties EventTab
Right click OnClick Event add Action Submit Form

Open the SearchForm's properties BeforeShow Event
  
	if ($Component->CheckBox1->GetValue() == Checked)  
	   $Component->Panel1->Visible = True;  
	else  
	   $Component->Panel1->Visible = False;  
  

This works, tested.
It might not be the most clean way to do it, but it does what you intended to do.
Remove the advanced search button and do the checkbox instead.

It is also possible to do the panel through JavaScript based on this checkbox scenario.
But I am busy as it is.

Walter
Aah, just noted the JS option is posted by RonB, thanks.

_________________
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
View profile  Send private message
bas
Posted: 08/05/2008, 8:17 AM

Great Wkempees

Works....after Ticking - I have to Submit a Search before it changes
(so the check box event is not firing even though I've done a Submit
OnClick)

I can live / play with that

But hey, Thanks very much for sorting this out - very much appreciated.



"wkempees" <wkempees@forum.codecharge> wrote in message
news:548985c410d8d3@news.codecharge.com...
>
Quote :
> To simplify I have started with a NEW Saerch & Grid without the update
> Panel
> Then just added a NORMAL panel
> Moved the fields I want for the Advance search on to it and set the panel
> Visible to NO
>
> read the above, then somewhere between the visible search and the
> invisible
> panel
> add a checkbox, from the Form Toolbox.
> Mouseselect the checkbox to see it's properties (defaultname CheckBox1)
> Set
> ControlSource to CodeExpression
> Checked = 1
> Unchecked =0
> DefaultValue UnChecked
> Switch to Checbox's Properties EventTab
> Right click OnClick Event add Action Submit Form
>
> Open the SearchForm's properties BeforeShow Event
>
  
> if ($Component->CheckBox1->GetValue() == Checked)  
>    $Component->Panel1->Visible = True;  
> else  
>    $Component->Panel1->Visible = False;  
>  
> 
>
> This works, tested.
> It might not be the most clean way to do it, but it does what you intended
> to
> do.
> Remove the advanced search button and do the checkbox instead.
>
> It is also possible to do the panel through JavaScript based on this
> checkbox
> scenario.
> But I am busy as it is.
>
> Walter
>
> _________________
> Origin: NL, Timezone GMT+1 (Forumtime +9)
> CCS3/4.01.006 PhP, MySQL (Vista/XP, XAMPP)
>
> if you liked this info PAYPAL me: http://donate.consultair.eu
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

wkempees


Posts: 1679
Posted: 08/05/2008, 8:29 AM

Quote :
(so the check box event is not firing even though I've done a Submit
OnClick)

It is the OnClick Event of the checkBox,
that you add (richtclick Add Action) action "Submit Form" to.

Unless anything else on the search form is stopping the Submit, it should fire.
Any Validations failing?

But hey, you are happy as is, so change title to [Solved] and enjoy.

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
View profile  Send private message
bas
Posted: 08/05/2008, 9:09 AM

Panel1 had a Panel1->Visible = true;

WORKS GREAT NOW

Thanks again

"wkempees" <wkempees@forum.codecharge> wrote in message
news:5489871cfe9436@news.codecharge.com...
>
Quote :
> (so the check box event is not firing even though I've done a Submit
> OnClick)
>
>
> It is the OnClick Event of the checkBox,
> that you add (richtclick Add Action) action "Submit Form" to.
>
> Unless anything else on the search form is stopping the Submit, it should
> fire.
> Any Validations failing?
>
> But hey, you are happy as is, so change title to [Solved] and enjoy.
>
> Walter
>
> _________________
> Origin: NL, Timezone GMT+1 (Forumtime +9)
> CCS3/4.01.006 PhP, MySQL (Vista/XP, XAMPP)
>
> if you liked this info PAYPAL me: http://donate.consultair.eu
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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