Even in this asynchronous ajaxized world there is some use of iframes.
By default there is an ugly border around iframe, so to get rid of it you either set no border on css:
iframe {
border: 0 none;
}
Or use argument frameborder because the common border="0" will simply not work. If you want to know why they put frameborder for iframe and not border? Ask W3C.
Archive for the ‘HTML’ Category
How to avoid bots (and not to use caption plugins which suck)… there is a trick that works almost always (well, It uses javascript and they work for me always and i never seen a bot avoiding it). Of course there are users disabling javascript but thats soooo ’90.
Better is to use plain javascript but with jQuery it will be faster [for me to write this]. So install jQuery.
So when creating a block for forms plugin, make it go elsewhere like <form id=”frmGuestbook” action=”http://go/away“>
MAYBE there are still users from ’90ties which use IE5.5 or Netscape Navigator and really have disabled javascript so maybe its a good idea to put a warnign too like <div id=”msgCantWriteGuestbookWithoutJS”>Sorry, you must have javascript to write enabled to write in guestbook</div>
Then, in the html header put this code.
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('#msgCantWriteGuestbookWithoutJS').hide();
$('frmGuestbook').attr('action', './put/the/real/link/here');
}
</script>
so what it does – with help of jquery it removes a warning and sets normal action attribute for form. Voila. Spam bot walks in, fills out data and gets redirected to http://go/away. Farewell!
there are other tricks but i will tell a bit later (if you dont figure out yourself). For example CSS and empty field trick – Make a 1×1 pixel transparent input field and name it “name” so bot will 1000% fill it in. And then when you put the posted data in database, just check for value in “name”. If it is filled in, then it was written by nonhuman (or really small miniperson who sees 1×1 pixel text field as normal text field). So, just ignore the post if “name” is not empty.
Anyway, captions are soooooo 2000….
Avoid spambots and spam in HTML forms.
Author: Edgars | Filed under: HTML, Javascript, jQueryI don’t have to explain that it’s much better to use neat fancy images instead of regular html buttons. And sometimes designer succeeds himself and ads something really cool that you can’t simulate with CSS alone so background image for button should be set. On the other hand there is this stupid IE7 bug (afaik IE8 is ok) where you can’t see the background image for an input button if CSS border is set to “none”. Read the rest of this entry »
Background image in input button for IE7
Author: Edgars | Filed under: CSS, HTML, Web DevelopmentWe all know how great is to make dynamic HTML lists so you may traverse into selections by taking into account what has been selected before. Superduper way would be to use AJAXized calls to server so it takes care of what should be displayed, but what to do if you have already two rendered HTML combo boxes (aka drop-downs) and just must make a JavaScript logic to take care of showing only those options from list 2 that correspond to the selection in list 1. Internet (google) has some examples using JS arrays which totally doesn’t suite me since i prefer “less code – less hassle” principle. And such arrays doesnt fit me since as i said – i have two generated lists and dont want to generate them as arrays and then build up in JavaScript which in my opinion is just an extra step.
Read the rest of this entry »

