|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
form action generally works with submit buttons. I have made a select pull down list and I want to use the changed status of the pull down to activate (a form?) to call search.php with the new selected item being passed to the search.php. I can take it from there and build the select list and build the html table for display.
Give code snipptets if possible or URL refs. |
|
#2
|
|||
|
|||
|
Tiny progress on activating page with pull down.
While 14 of you read and did not reply with any hints, I futzed around until I got a partial answer. I have code in left frame with pull down and "GO" submit button. When I select an item in pull down and click "GO", BOTH left and right pages are changed. The left changes to a 404 error. The right plays the search.php page.
What am I doing wrong ? Segment from manage.php [manage.php is being overwritten with a 404 error.] <b>Search Sanity Savers</b> <!-- Begin processing the SELECT now. --> <form method="post" ACTION="search.php" target="right" > <select name="aid" size="1"> <?php> $skills = @mysql_query('SELECT AID, SKILLDESC FROM skills'); if (!$skills) { die('<p>Error retrieving skills from database!<br />'. 'Error: ' . mysql_error() . '</p>'); } while ($skill = mysql_fetch_array($skills)) { $aid = $skill['AID']; $skdesc = $skill['SKILLDESC']; echo("<option value='$aid'>$skdesc</option>\n"); } ?> </select><br /> <input type="submit" name="go" value="GO" onClick="location = this.form.aid.options[this.form.aid.selectedIndex].value;"> </form> |
|
#3
|
|||
|
|||
|
Well, after many days of struggling, I have answered my own quesiton.
I finally found out how to do it myself. It is by using <form> and the onclick=submit() funciton. Make up a search.php, it there is no right frame it opens a new window. <pre> <html> <head> </head> <body> <?php if (isset($_POST['aid'])): echo('value is here ' . $_POST['aid']); else: echo(' Choose your poisen! '); endif; ?> <!-- Begin processing the SELECT now. --> <form method="post" ACTION="search.php" target="right"> <select name="aid" size="1" onchange="submit()" > <option value='12'>Option one</option> <option value='13'>Option two</option> <option value='14'>Option three</option> <option value='15'>Option four</option> <option value='16'>Option five</option> <option value='17'>Option six</option> </select><br /> </form> </body> </html> </pre> Sorry, I tried to format this nicely but system ate the leading spaces. I even added less than pre greater than thingy but still no dice. |
|
#4
|
||||
|
||||
|
Try this
This should change the right frame to whatever the value of the dropdown is. The dropdown values would have to have the value of a web page such as search.php
Code:
<b>Search Sanity Savers</b>
<!-- Begin processing the SELECT now. -->
<form method="post" ACTION="javascript:;" target="right" >
<select name="aid" size="1">
<?php>
$skills = @mysql_query('SELECT AID, SKILLDESC FROM skills');
if (!$skills) {
die('<p>Error retrieving skills from database!<br />'.
'Error: ' . mysql_error() . '</p>');
}
while ($skill = mysql_fetch_array($skills)) {
$aid = $skill['AID'];
$skdesc = $skill['SKILLDESC'];
echo("<option value='$aid'>$skdesc</option>\n");
}
?>
</select><br />
<input type="submit" name="go" value="GO"
onClick="location = this.form.aid.options[this.form.aid.selectedIndex].value;">
</form>
Since I don't know what your option tag values look like that's the best I can do. If you want to post your option tags or an example then go for it and we'll see if my suggestion applies still.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > How to use pull down with form action ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|