[FX.php List] FMSkipRecords

DC dan.cynosure at dbmscan.com
Wed Mar 29 12:03:45 MST 2006


Replies inline below...

Kevin Futter had written:
> On 29/3/06 3:31 AM, "DC" <dan.cynosure at dbmscan.com> wrote:
> 
> 
>>This design has the benefit of actually falling back to a clickable link
>>if JS is not available - so it degrades gracefully.
> 
> 
> But your link doesn't go anywhere, which is my point. It's a dummy used to
> trigger some JavaScript. If JS is off, it won't degrade gracefully at all,
> just fail. Completely. Here's a nice synopsis that talks about some of these
> issues:
> 
> http://www.wait-till-i.com/index.php?p=104
> 

Yes, the new link does degrade gracefully in the new example I posted -
you know, the one after you guys complained about my voiding all over
the place. Here, I will post it again. Please, disable your javascript
and reload the page with the following code and give it a try... when I 
have JS on, it goes to file1.php, when i disable JS it goes to 
file2.php. I consider that degrading gracefully.

<FORM NAME="sub" METHOD="POST" ACTION="file1.php">
<input type="hidden" id="data" name="data" value="mydata">
</FORM>
<a href="file2.php"
ONCLICK="document.sub.submit(); return false;"
target="_blank">LINK TEXT HERE</a>

You see that you don't *have to have* a dummy link... your file2.php can
actually be a real link - in fact you can go to file1.php in the href if
you want and then handle the lack of POST data there.

> 
>>Kevin, the onsubmit button approach gives you a button - not a text
>>link. So, if you are looking for a page full of grey buttons then use
>>the standard form element button. But, if you want actual text links to
>>submit forms and carry POST data along you have to do this little
>>javascript dance. And yes, javascript is required - so if you want your
>>script to degrade gracefully, you'd better have some kind of fallback
>>like an a href tag.
> 
> 
> Your point is taken about the onsubmit buttons, but you I can't see anywhere
> in the code supplied so far in this thread (which is now wildly off-topic!)

Actually, I believe we are still squarely on the topic of...

"how to keep your search params intact so that you can pass them from 
request to request because FX linkPrevious and linkNext are applicable 
only to GET implementations." (whew, what a mouthful).

> that gives a valid URI in a href as a graceful fallback. For example:
> 
> <a href="javascript:void(0)"
>  ONCLICK="document.sub.submit(); return false;"
>  target="_blank">LINK TEXT HERE</a>
> 
>>Finally, if you want to be completely standards compliant (and not just
>>hack a few form-submitting links together for a one-off) you probably
>>want to check out the 'behaviour.js' library to get 'clunky' javascript
>>out of HTML altogether.
>>
>>http://bennolan.com/behaviour/
> 
> 
> This is called 'unobtrusive JavaScript', and of course is far and away the
> neatest, cleanest and most extensible approach to this sort of thing.
> Ideally you'd have something like this:
> 
> <a href="fallback.php" class="submitForm">Link Text</a>
> 
> And then use Unobtrusive JS to trigger an onclick based on the class name of
> the link. With no JS available you'll get a fallback page. All the JS logic
> is in an external file, leaving only clean, semantic markup.

Yes, and if you don't want to bother installing another JS library and 
tweaking your pages to adapt to the new (notably, cleaner and 
standard-bearing) JS approach, you can just throw the FORM in with some 
JS in there to carry POST data around in every link you make that deals 
with a database.

> 
> 
>>thanks for the lively discussion - i feel quite edified.
>>dan
> 
> 
>  My pleasure! I suppose we should get back on topic now ...
> 

Yes, i beleive my topic is "get back to work."

Cheers,
dan


More information about the FX.php_List mailing list