View Full Version : Help to activate info in Iframe using MySQL data in listbox to
Rob (SA)
07-10-2010, 04:05 PM
Hi Folks,
I have three list boxes that populate names from MySQL.
What I would like to do is instead of using the GO button, pick on the name in the list. Once the name is picked specific information relating to that person will appear in the Iframe.
Please check this link (http://www.gnjgf.co.za/rankings.php) out to see what I propose.
If there is anyone who can help I will be more than happy.
Regards
Rob
djr33
07-10-2010, 09:04 PM
You only want to replace the "go" button with an automated change?
This isn't related to PHP or MySQL. All you need is Javascript, and very simple Javascript:
<select onChange="this.form.submit();">
That should do what you want. If you have problems with the MySQL/PHP, then this will need to be done on the page within the iframe, based on the sent information.
Rob (SA)
07-11-2010, 06:41 AM
Hi,
Thanks for the prompt reply.
You are correct - in that MySQL doesn't do it.
Ajax is currently providing what I have.
So if I am correct in what you are suggesting is that I can do away with the "GO" button and make this change
<select onChange="this.form.submit();">
Would I be correct in saying that the name of the Iframe would be between ()?
Regards
Rob
djr33
07-11-2010, 02:57 PM
No, that doesn't yet do anything for the iframe. That code just submits the form automatically when you change the value of the select. You could set <form ... target="ifranename"> and then it would do what you want. (Target is apparently not part of the newer/stricter forms of valid html, but it works fine, and I don't really see a better alternative here.)
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.