Just my luck and I ran into the dreaded submit is not a function javascript error.
Here’s the scenario.
While coding javascript along, you get a form via id or name on your html page and calls the submit() function on it. You think it should just behave as expected (submits the form) instead nothing happens and in firebug, you get a submit is not a function error. You are like WTF is going on? You start to wonder if you remembered the syntax correctly so you do some research and all the pages tell you yes it’s just submit() and nothing else.
Finally you start to search on the error “submit is not a function” you get to this page and you learned:
The reason was the statement “formObj.submit();” in the javascript was colliding (resulting in ambiguity within the browser) with the form button, which was also named “submit”.
So just rename the element within the form tag that is named “submit” will fix the problem.
Here’s an example.
HTML:
<form id="search"><input name="something" /><input type="submit" name="submit" /></form>
Javascript:
function submitForm() {
document.getElementById('search').submit();
}
gives “submit is not a function” error.
Change HTML to:
<form id="search"><input name="something" /><input type="submit" name="NOT_SUBMIT" /></form>
I write my CSS from scratch and I know enough tricks/hacks to pull out most of all what I want to accomplish. Although I’ve always heard the yahoo YUI project and understand what its reset css achieves, I never knew there are so many other CSS frameworks out there. Hidden pixels has listed a great number of them. I don’t know if I will consider using them. I can’t see I will gain a lot of benefits from what I’ve done by using a framework but I might look into it since I have some time off work coming up
sIFR lets you use your favorite font on your websites by cleverly working with Flash, JavaScript and CSS.
I saw it used in the Bella theme. I don’t know how compatible it is for all browsers but I might just try it out in my future themes
Posted by dodo in chinese
Wow, apparently we can now handle chinese URLs. The first one I noticed is this new soap opera’s official website: http://www.原來我不帥.tw/
I needed a text counter at work. I searched around trying to find a jQuery plugin that fits the bill but I didn’t find anything. So I wrote one myself. Check it out
It should be pretty flexible.
- Requires jQuery
- Define the maximum of characters the user may input
- May be applied to one or more input text or textarea fields
- Also disable the user from entering more characters after s/he reaches the maximum
Live demo + Documentation + Download
I’ve been using foobar2000 as my media player for quite some time. It’s lightweight, highly customizable and uses little resource. Today while I was listening to some soothing music, I remembered back then I had a CD player that had a sleep function where you can set a timer to have it automatically turn off in 30 minutes. I thought would it be nice to do something like that with foobar since I leave my laptop on all the time by my bed. Sure enough, I didn’t have to look far, foobar’s got an awesome plugin foo_scheduler that does that and much more. It can perform many actions on a scheduled basis including, start, stop, lower volume, exit and even shutdown your computer. Alternatively this is the first thread I stumpled upon. It contains much valuable information for scheduling your computer.