HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 9th, 2004, 02:36 AM
Prayer Prayer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: eastern PA
Posts: 8 Prayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Prayer
Question How to use pull down with form action ?

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.

Reply With Quote
  #2  
Old June 9th, 2004, 02:15 PM
Prayer Prayer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: eastern PA
Posts: 8 Prayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Prayer
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>

Reply With Quote
  #3  
Old June 14th, 2004, 08:14 AM
Prayer Prayer is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: eastern PA
Posts: 8 Prayer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to Prayer
Talking

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.

Reply With Quote
  #4  
Old June 16th, 2004, 09:38 AM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
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.


Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > How to use pull down with form action ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway