Help!!!! Toggle Menu

Hi,

this is my site.
http://www.churchesbulletin.com/post.cfm?CHID=11

I am having problem with my left toggle menu.  

I am not sure why when I select "search by state" button I enter anything in the search text box and select michigan then click on the search button.

it does not submit the form and the search by state menu it closes.  

I want it to stay open and to be able to submit my selection.

Thanks,
lulu
<input id="BtnST" type="button" value="Search" name="BtnST" onclick="valState();"/>


	
function valState(){

var errorMsg = "";
var errorField = null;

var DcFrm = document.FRMAcc;

 if (DcFrm.TxtSearchST.value == ""){
      errorMsg += "Search for field is empty\n";
	if (errorField==null) errorField=FRMAcc.TxtSearchST;
  }
  
if (DcFrm.DispStateBoxST.selectedIndex == 0)
{
  errorMsg += "Select a state\n";
  if (errorField==null) errorField=FRMAcc.DispStateBoxST;
 }

  if (errorMsg != "") {
    errorMsg += "---------------------------------\n\n";
    errorMsg += "Please correct the problem(s)\n";
    alert(errorMsg );
    errorField.focus();
    return false;
  } 
  
	FRMAcc.method="post"; 
	FRMAcc.action="post.cfm?CHID=" + '<cfoutput>#URL.CHID#</cfoutput>';
	FRMAcc.submit(); 
 
}

Open in new window

lulu50Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
your button : <input id="BtnCT" type="button" value="Search" name="BtnCT" onclick="return valCity();">

your function must return true or false (ok) :
check at the end of your function :
      
function valState(){

var errorMsg = "";
var errorField = null;

var DcFrm = document.FRMAcc;

 if (DcFrm.TxtSearchST.value == ""){
      errorMsg += "Search for field is empty\n";
      if (errorField==null) errorField=FRMAcc.TxtSearchST;
  }
 
if (DcFrm.DispStateBoxST.selectedIndex == 0)
{
  errorMsg += "Select a state\n";
  if (errorField==null) errorField=FRMAcc.DispStateBoxST;
 }

  if (errorMsg != "") {
    errorMsg += "---------------------------------\n\n";
    errorMsg += "Please correct the problem(s)\n";
    alert(errorMsg );
    errorField.focus();
    return false;
  }
 
      FRMAcc.method="post";
      FRMAcc.action="post.cfm?CHID=" + '<cfoutput>#URL.CHID#</cfoutput>';
      FRMAcc.submit();

return true;

}
0
lulu50Author Commented:
leakim971:

Thank you for helping me.  

I did changed it to onclick="return valCity();">
and at the bottom return true;

I am still not able to post for some reason.  

Do you think because of my left menu once I click on the submit button in the "search by state" it reload the page and closes my menu?

when the user click on one of the free button I want the menu to stay open unless the user change
the selection.

I know I have to do something in this code but what and how I have no idea.


<script>

$(document).ready(function() {
    $(".divMain").click(function(){
        $(".divSub").hide();
        $(this).next(".divSub:eq(0)").show(50);
    });
});

</script>



0
leakim971PluritechnicianCommented:
I'm still seeing : <input id="BtnCT" type="button" value="Search" name="BtnCT" onclick="valCity();">
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

leakim971PluritechnicianCommented:
my bad I tried by city...
0
leakim971PluritechnicianCommented:
Your is successfully submitted on my side
0
leakim971PluritechnicianCommented:
Your form is successfully submitted on my side
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leakim971PluritechnicianCommented:
on a previous question I said replace :

<script type="text/javascript" src="JS/jquery.min.js"></script>
<script type="text/javascript" src="JS/jquery-latest.min.js"></script>  

by :

<script type="text/javascript" src="JS/jquery-latest.min.js"></script>  
0
lulu50Author Commented:
to test if the form getting submitted I put this:
------------------------------------
I Entered in my text box this:
<cfif isdefined("form.BtnST")>
      <cfoutput>#form.TxtSearchST#</cfoutput>
</cfif>
------------------------------------
it's on the top of the page

I should see what I entered in my state text box.

I am getting anything

I replaced my javascript files like you said.

how can I make my left menu by default to open
search by church menu
and
when the user click on any other button to keep the menu open until they chose a different one.


something need to change in here

<script>

$(document).ready(function() {
    $(".divMain").click(function(){
        $(".divSub").hide();
        $(this).next(".divSub:eq(0)").show(50);
    });
});

</script>

but I don't know what.

0
lulu50Author Commented:
leakim971:

for testing to see the form is getting submitted I did this:

clicked on Search by state

in my search box I put Maya
and selected MI then clicked on submit

the page got reloaded I opened the view source
and searched for "Maya" I cannot find "Maya"

If the form has been submitted I should see "Maya"
no?

what do you think?    menu
0
leakim971PluritechnicianCommented:
try with something else than the button, for example TxtSearchST
0
leakim971PluritechnicianCommented:

------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtSearchST"

tototo
------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtStateST"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="DispStateBoxST"

22
------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelSTPost"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelCatg"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelStDt"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="dateFromST"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="dateToST"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="PriceFromST"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="PriceToST"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtSearchCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtStateCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="DispStateBoxCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtCityCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelSTPostCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelCatCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelDtCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="dateFromCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="dateToCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="PriceFromCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="PriceToCT"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtSearchCH"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtState"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="DispStateBox"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtCity"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="TxtChurch"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="GetChurch"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelSTPost"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelCatCh"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SelDtCh"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="dateFromCh"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="dateToCh"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="PriceFromCh"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="PriceToCh"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="txtQSearch"


------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="SortData"

 
------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="RadioGroup1Adv"

0
------WebKitFormBoundaryTqTxf0hnuKYv3Mty
Content-Disposition: form-data; name="CHID"

11
------WebKitFormBoundaryTqTxf0hnuKYv3Mty--

Open in new window

0
lulu50Author Commented:
leakim971:

you are right the form is getting submitted.  
I just have to change my logic to get it to work.

as for the second question I need to open a new question for it.

I am not good with Jquery I need your help with my new question.

thank you
lulu
0
lulu50Author Commented:
Thank you for helping me
A++++++++++++++++++++++++++++++
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AJAX

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.