Menu
I am looking for a *easy to use
As I envisage it, I have a number of input forms which pass search criteri ao php programs which execute a mysql search, then return formatted data. I want this formatted data to appear in a modal window with a defined size, and vertical scrolling if the data overflows.
Any advice from out there? I’m banging my head against a wall in here…
Cheers
D
hanks for the reply.
Yes it was ambiguous, sorry about that, I was really just musing rather than presenting a serious question, but that wasn;t clear either :o
The html code in the web page is this:
<form name="name" action="searchscripts/search_last_name.php" method="post"[COLOR="DarkRed"]onsubmit="return GB_showCenter('Search results', this.action, 320, 640)"[/COLOR] >
<input type="text" name="last_name" />
<input type="submit" name="Submit" value="Search" />
</form>
The form calls a php script which
1. Retrieves the POST variable 'last_name' search 2. Searches the database 3. Returns the result through the greybox GB_show function (javascript) for display in modal window.
The process is, however interrupted by the greybox js scripts, which appear to null out the superglobals $_GET, $_POST, $_REQUEST, which makes retrieval of the search key difficult or impossible, so the search fails.
I'm pretty sure where this is happening (in the greybox js code) because if I remove the 'onsubmit' part of the form code, all is well and my php script returns the data query correctly. But not in the desired modal window of course.
All very odd and beyond my ken entirely. I may need to go the route you suggest - beyond my reach as an amateur with only bits and pieces of knowledge though.
Cheers, and thanks very much for the assistance ?[/QUOTE]
Off topic here but I would not use the onSubmit function (maybe I'm being perdantic). I would use a library to process what you are doing as it would make it a lot easier, EG jQuery, for which you can use:
$('form').submit(function(){
});
If you post your code for the GB_showCenter function I will rewrite it to jquery for you, and also greybox isnt the nicest of lightboxes (not just appearance wise). Search for a jQuery lightbox.. believe me, jQuery is not hard at all and will improve your client side coding tenfold.[/QUOTE]
That particular bit of code using jQuery is also adding an onsubmit handler to the form element. There is no difference except that you would then have to include the huge library (relative to 0 of course) file in your bandwidth requirements.[/QUOTE]
I think though, for one call of a library, it can reduce execution time and also if more javascript is used down the line it will reduce development. I wouldn't call 24kb huge.. I think when the function is fully built then 24kb is not much, besides, jQuery lightbox is only 7 kb packed while greybox is 22. Why are you advising him not to use jQuery? It wont have any detrimental effect at all.
No point causing an argument over something which doesnt need to be argued about ?[/QUOTE]
I think when the function is fully built then 24kb is not much, besides, jQuery lightbox is only 7 kb packed while greybox is 22.[/QUOTE]
My point was only that there is no need to include the whole 24kb for that single line when 0kb does the same thing. If there is other use for the library then that is a different matter entirely. The only issue I have with the frameworks is when someone doesn't understand the basics of javascript and uses a framework as a "magic" solution. When used improperly any framework can slow the loading of a site or in worst case cause errors due to inadequate understanding of basic concepts.[/QUOTE]
Thanks for the responses guys, I really appreciate it.
I chose greybox for 3 reasons: firstly the minimal frame design on screen, secondly the (to me) easily understandable means of calling the GB_showCenter function, and lastly (most importantly), because I can output data from a mysql search query, whereas many lightboxes are only for pics and galleries. Having wrestled with it for ages though, it seems buggy and temperamental so I am on the verge of SC'ing it.
Before I take up Ricky's kind offer to write the code in jquery, do you have any suggestions as to a suitable alternative choice of lightbox? One that will display formatted data output from a database query?
Really grateful for the assistance...[/QUOTE]
You can put just about any response from a PHP script into any other language (HTML, XML, Javascript, etc). After the PHP has process the "echo"ed code is sent as plain old human readable (in most cases) text just like a plain old html file would.[/QUOTE]
0.1.9 — BETA 6.2