Hi,

I want to create list of items on my header to which if selected sends that value to my Div class where my search code is there as input to it.

I have seen href works for pointing to.php with id value as parameter. but what is syntax for pointing to div class with parameter value.

my href would look like this but this doesn't work: 
<a href=#hovergallery?var="furniture">furniture</a>

my div class is:
<div class="hovergallery" id="hovergallery">
    <?php

                        include('connection.php');
                        $ecategory_search=$_GET['id'];
....

Kindly send me href syntax for it.

Regards,
Ankit

Recommended Answers

All 9 Replies

You'll need Javascript/jQuery to achieve what you need IMO. Am I right, that if you click the link you want to prefill a textbox with "furniture"?

list would be displayed like : furniture cosmetics interior

if user cicks on furniture in backend code this selection goes as input to my search query and it displays picture of furniture shops. it will dsplay images at bottom of page where my DIV is placed.
I was able to do same with dropdown menu bar but I thought displaying list on top would be easier for my user than drop down.

href: is it not possible to use reference to DIV as well as pass variable through it?

if I use this syntax it gives me error saying no access on your server
Syntax:
<a href=\"#_hovergallery?id=Furniture\">Furniture</a></p>

output:
http://localhost/%22#_hovergallery?id=Furniture\"

Forbidden
You don't have permission to access /" on this server.

If I user this syntax
<a href="#hovergallery?id=Furniture\">Furniture</a></p>
it goes to no where

href: is it not possible to use reference to DIV as well as pass variable through it?

Not possible. A DIV is a HTML block and cannot accept parameters like a script can. You'll need to use Javascript/jQuery/AJAX.

thanks,
I am not very familiar with javascripts can someone give code for it.

but if I pass value through drop down selection within form action then DIV is receiving value and able to run my search query.
so why is that through href its not possible. drop down and href both are html syntax.

You can bind an ajax call on the selector of your choice with the event of your choice. Using jQuery helps stream line the code for making a call with AJAX to your script that runs the query, then returns the results back to the page, in the div, table, whatever you choose.

You're going to have to do a little reading and experimenting to get started.

http://api.jquery.com/jquery.ajax/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.