SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need help with lookup problem

    My lookup's already done but I'm having a problem with retaining the info in it.
    when I finish the search the info is lost.
    Any help would be greatly appreciated

    Here's a snapshot of the lookup.

    And here's a link to the webpage.

  2. #2
    SitePoint Zealot Kayarc's Avatar
    Join Date
    Sep 2009
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Daniel,D,D View Post
    My lookup's already done but I'm having a problem with retaining the info in it.
    when I finish the search the info is lost.
    Any help would be greatly appreciated

    Here's a snapshot of the lookup.

    And here's a link to the webpage.
    Not sure why you have JavaScript constantly submitting the form but...

    PHP Code:
    <?php
    print_r
    ($_POST);  
    ?>
    should show you all available $_POST data
    Phoenix Arizona Web Design | info *at* kayarc.com | 602.633.2676

  3. #3
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The lookup works fine and go's where I want it to go.
    But after I press the go button it loads the right page,
    the information from the lookup is gone.
    I already tried ($_GET,$_POST,$_REQUEST) but none of them worked.

  4. #4
    SitePoint Zealot Kayarc's Avatar
    Join Date
    Sep 2009
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Daniel,D,D View Post
    The lookup works fine and go's where I want it to go.
    But after I press the go button it loads the right page,
    the information from the lookup is gone.
    I already tried ($_GET,$_POST,$_REQUEST) but none of them worked.
    If
    PHP Code:
    <?php
    print_r
    ($_POST);
    ?>
    does not have the data, you are not submitting post data.. simple as that. Ensure you are submitting a post with your form.
    Phoenix Arizona Web Design | info *at* kayarc.com | 602.633.2676

  5. #5
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is your problem:
    Code:
    <!--BEGIN Search Box 
    
    
    <form action="index.php?page=shop.browse&option=com_virtuemart&Itemid=1" method="post">
    
    	<p><label for="keyword">Search</label></p>
    	<p>
    
     <input name="" size="12" type=""  title="" class="" id=""  />
    
    
    		<input class="button" type="Go" name="Go" value="Go" />
    	</p>
    </form>
    In that form, where are those menus?
    a) In the form tags so they will be submitted
    b) Above the form tags so select box values WON'T be submitted..

    Answers on a postcard..

    Treat the entire thing as a form and you'll find that it will submit everything when you click that search button. Now before you ask I hear what your already thinking.. "How will I know if its a drop down option submitting it or the button?"

    Well my friend, you already have the make, model etc set in the the parameters of the onchange events so all you need to do is test the submission for:
    a) the search button being submitted (although if the user hits enter on the text box thats pointless)
    b) check to see if all 4 select boxes have been submitted already - IE use sessions

    Hope that helps!!

  6. #6
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,094
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    @tangoforce
    You are looking at the wrong form, that one is commented out.

    @Daniel,D,D

    Your form is posting because it does update the fields correctly. With that in mind, how do you tell which time it is posted (it gets posted four times) to act on the results?

    What do you use to trigger the final results process?
    What I lack in acuracy I make up for in misteaks

  7. #7
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you managed to get it working?

  8. #8
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,094
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Post your code that is supposed to process (lookup the results).

    Actually everything comes up as unavailable so I have no idea what you are trying to accomplish.

    OT Why are you posting the form everytime a selection is selected? AJAX might be a better alternative. Also What is that huge encrypted field, VIEWSTATE?
    What I lack in acuracy I make up for in misteaks

  9. #9
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lorenw View Post
    @tangoforce
    You are looking at the wrong form, that one is commented out.
    Quite right! It was a rather late last night when I posted

    What about the one below it though?

    Code:
    <form action="index.php?page=shop.browse&amp;option=com_virtuemart&amp;Itemid=1" method="post">
     <input value=""; name="keyword" size="12" type=""  title="search" class="inputbox" id="keyword"  />
    <input class="button" type="submit" name="Search" value="Go" />
    </form>
    Thats still a submit button and at the end of the day as I understand it the button will only submit the content of that form - The text box. Those select boxes are in a different form thats why it is posting and updates the fields correctly is it not?

  10. #10
    SitePoint Enthusiast Daniel,D,D's Avatar
    Join Date
    Apr 2009
    Location
    Sandy utah USA
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Post your code that is supposed to process (lookup the results).
    Well My code is quite messy. It could take me a little while to make it readable and hide all the valuable info, passwords, hidden urls ect

    Quote Originally Posted by lorenw View Post
    What do you use to trigger the final results process?
    Well I have the 2 forms one with the drop down menus and one with the button.
    The first form uses drop down menus that use a mixed of php and java script to grab info from the db and display it.

    The other form just has a simple button which grabs the result from the first form and displays it in the box next to the go button.

  11. #11
    SitePoint Guru
    Join Date
    Aug 2009
    Posts
    669
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Daniel,D,D View Post
    But after I press the go button it loads the right page,
    the information from the lookup is gone.
    Because the go button is only submitting one value? - The one in the text box?

    Quote Originally Posted by Daniel,D,D View Post
    The other form just has a simple button which grabs the result from the first form and displays it in the box next to the go button.
    Correct me if I am wrong.. but you are trying to make the select boxes show the same selections after the go button has been clicked correct?

    You've also said that you can not find this data in GET or POST.

    Maybe I'm missing the point entirely...

  12. #12
    SitePoint Zealot Kayarc's Avatar
    Join Date
    Sep 2009
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by lorenw View Post
    OT Why are you posting the form everytime a selection is selected?
    Still wondering this myself.
    Phoenix Arizona Web Design | info *at* kayarc.com | 602.633.2676

  13. #13
    SitePoint Wizard lorenw's Avatar
    Join Date
    Feb 2005
    Location
    was rainy Oregon now sunny Florida
    Posts
    1,094
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    On line 437 I do see your 2nd form. BUT

    Code:
    <form action="index.php?page=shop.browse&amp;option=com_virtuemart&amp;Itemid=1" method="post">
     <input value=""; name="keyword" size="12" type=""  title="search" class="inputbox" id="keyword"  />
    <input class="button" type="submit" name="Search" value="Go" />
    </form>
    Is not the correct way to do things, all of your values are in a GET string to the script page that you post to.

    put these (below) into hidden form fields and then your data will be posted

    ?page=shop.browse&amp;option=com_virtuemart&amp;Itemid=1"

    The above will be treated as GET variables. Or change your process script to look for GET vars.
    What I lack in acuracy I make up for in misteaks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •