[FX.php List] FMSkipRecords

Kevin Futter kfutter at sbc.melb.catholic.edu.au
Mon Mar 27 15:23:46 MST 2006


On 28/3/06 4:40 AM, "DC" <dan.cynosure at dbmscan.com> wrote:

> Chris,
> 
> Reading your explanation of how to implement links with embedded search
> parameters, a small little thought popped into my head...
> 
> Aren't the linkNext and linkPrvious array items returned by FX
> implementation dependent (meaning they only work when you use GET) and
> therefore shouldn't they be removed/deprecated from FX since (as you
> indicate) there are many ways to maintain state, search parameters, and
> paging contexts (such as GET, POST, cookies, sessions)?
> 
> Also, I believe the approach you describe below of making links into
> FORM elements is a bit abstract. Here's code that shows one way to turn
> a link into a FORM that will allow you to maintain hidden variables in
> the form (requires javascript):
> 
> <FORM NAME="sub" METHOD="POST" ACTION="file.php">
> <input type="hidden" id="data" name="data" value="mydata">
> </FORM>
> <a href="javascript:void(0)"
> ONCLICK="document.sub.submit(); return false;"
> target="_blank">LINK TEXT HERE</a>
> 
> This puts a simple form (add hidden elements for any data that you want
> to shepherd into the next form submission) right before the link that
> will use it. Tested in Safari, Firefox (Mac), and IE6.
> 
> Cheers,
> dan

Just a quick note about the JavaScript here: please avoid the "javascript:"
pseudo protocol; it's invalid and clunky, and in your example, not even
necessary. The "return false" should be sufficient. Of course, the form will
fail completely if JS is disabled or unavailable.

Additionally, if you're going to use hrefs, they should point a legitimate
URI. If no such thing exists for your purpose, then you can simply use the
onclick handler on a more appropriate element, such as <span> or even <p>.
You can use CSS to make it look like a traditional link, even changing the
cursor.

-- 
Kevin Futter
Webmaster, St. Bernard's College
http://www.sbc.melb.catholic.edu.au/





More information about the FX.php_List mailing list