1,105,534 Community Members

Form and PHP help

Member Avatar
Phillamon
Junior Poster in Training
96 posts since Oct 2010
Reputation Points: 26 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 1 [?]
 
0
 

Hi!

I would just like to know if its possible to give an linked image the ability to send the form instead of a submit button? Like in the example below:

<form method="post" action="Search.php">
            <table id="search">
                <tr>
                    <td>
                        Search:  <input type="text" name="search" id="search" placeholder="Search for friends"/><td><a href="Search.php" action="Search.php"><img src="graphics/search.png" id="search_pic"/></a></td>
                        <input type="submit" id="submit"/>
                    </td>
                </tr>
            <table>
        </form>

Because I don't want a submit button. I want to use the picture to send the forms data instead of the actual submit button.

In the receiving file Search.php

$request  = $_POST["search"];

and it doesn't receive the value "search"

Member Avatar
cwarn23
Occupation: Genius
3,028 posts since Sep 2007
Reputation Points: 387 [?]
Q&As Helped to Solve: 281 [?]
Skill Endorsements: 15 [?]
Team Colleague
Featured
 
1
 

Try the following:

<form method="post" action="Search.php">
            <table id="search">
                <tr>
                    <td>
                        Search:  <input type="text" name="search" id="search" placeholder="Search for friends"/><td><input type="image" src="graphics/search.png" id="submit"/></td>
                    </td>
                </tr>
            <table>
        </form>

That is how you have a submit button which is an image button.

Member Avatar
Phillamon
Junior Poster in Training
96 posts since Oct 2010
Reputation Points: 26 [?]
Q&As Helped to Solve: 5 [?]
Skill Endorsements: 1 [?]
 
0
 

Awesome! Thanks once again!

Didn't really know about the type="image" statement. Yet so your learn!

Question Answered as of 2 Years Ago by cwarn23
Member Avatar
selina12
Newbie Poster
13 posts since Nov 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I don't think it is possible with the image, because if we have to pass any value at the time of navigation then how it can be passed??

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: