First I want to thank those that helped with a previous question regarding OnClick. Perhaps you can bear with my on another thought I had.
Throughout my page I want to provide the user either buttons or text that will make selections from my database based on the various criteria. As an example, if they click the graphics image "A", it then refreshes the screen and in a section of the screen, all members with names beginning with an "A" appears.
One option is to create 26 pages and use the following OnClick event:
<img border="0" src="images/alphabet/A.jpg" width="24" height="24" vspace="2" onclick=" FP_goToURL(/*href*/'directories/directory%20(a).php')"></td>
Within the called page I would have a Select statement such as:
$query_members="SELECT * FROM Members WHERE BusinessNameKey = 'A' ORDER BY BusinessName";
$query_members="SELECT * FROM Members WHERE BusinessNameKey = 'B' ORDER BY BusinessName";
etc.
Life would be made a whole bunch simpler if I could pass a variable to the called URL. Does anyone know the syntax of such a statement?
My second question is this....
On the primary page, I am also displaying from my database various Business Types. As those business names are drawn from the database I would like to format them with OnClick properties so that when the user clicks them I go to another page, once again passing the text/Business Type selected. The called URL would have a SQL statement such as:
$query_members="SELECT * FROM Members WHERE BusinessType = $businesstype ORDER BY BusinessName";
I am lost as to the syntax of this statement as well.
I would once again like to thank you in advance for any input you could provide...
Passing Variables With Onclick...
Moderator: General Moderators
-
Grandpa0594
- Forum Newbie
- Posts: 2
- Joined: Fri Aug 03, 2007 3:40 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Proper (syntax highlighting) tags.califdon wrote:Please post your function for us. (And please use the Code tag around your code when you post it.)
Code: Select all
is to be used as a last resort, not a first.feyd wrote:Proper (syntax highlighting) tags.califdon wrote:Please post your function for us. (And please use the Code tag around your code when you post it.)Code: Select all
is to be used as a last resort, not a first. [/quote]Thanks for the correction, feyd. I'll try to remember.