#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    5
    Rep Power
    0

    Creating a form from a Javascript nav bar


    I have created a nav bar with mouse over images in Dreamweaver. I now want to use these buttons to provide an input value for a PHP query. Below is the code for just one of the buttons, I would like to provide each button with an id value eg. 1, and then this will be passed to the PHP query which will display the results.

    Obviously we will need to create a form and the action will be the PHP query page:

    <form action="./teamsresults.php" method="post">

    But what input types etc do I use to turn these buttons into a form?

    <tr>
    <td><input type = <a href="javascript:;" target="_top" onClick="MM_nbGroup('down','group1','Ferrari','buttons/ferrariu.png',1)" onMouseOver="MM_nbGroup('over','Ferrari','buttons/ferrarid.png','buttons/ferrarid.png',1)" onMouseOut="MM_nbGroup('out')"><img src="buttons/ferrariu.png" alt="Ferrari" name="Ferrari" width="130" height="30" border="0" onload=""></a></td></tr>

    Any help would be appreciated.
  2. #2
  3. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2001
    Location
    UK
    Posts
    543
    Rep Power
    58
    How about:
    PHP Code:
    <input type=image name="1" src="img src=buttons/ferrariu.png alt=Ferrari name=Ferrari width=130 height=30 border=0" onClick"MM_nbGroup('down','group1','Ferrari','buttons/ferrariu.png',1)" onMouseOver="MM_nbGroup('over','Ferrari','buttons/ferrarid.png','buttons/ferrarid.png',1)" onMouseOut="MM_nbGroup('out')"
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2002
    Location
    Queensland, Australia
    Posts
    827
    Rep Power
    141
    Instead of using the POST method you could use the GET method. This way your nav buttons can be standard HREF's with the value you want to pass appended to the end of the URL they link too. I prefer to use this method over using forms sometimes.
    Ooh, they have the Internet on computers now!

IMN logo majestic logo threadwatch logo seochat tools logo