Skip to content

Tag: javascript

Disable submit button on form submit

I wrote this code to disable submit buttons on my website after the click: Unfortunately, it doesn’t send the form. How can I fix this? EDIT I’d like to bind the submit, not the form 🙂 Answer Do it onSubmit(): What is happening is you’re disabling the button altogether before it actually tri…

PO Box Regular Expression Validation

Here’s my code, but I can’t ever trigger the alert. Answer In javascript, you have to escape your slashes: Also, you could reduce your pattern a bit by using case-insensitive matching: Note: Your regex also matches on addresses such as: 123 Poor Box Road 123 Harpo Box Street I would suggest also c…

Set of objects in javascript

I’d like to have a set of objects in Javascript. That is, a data structure that contains only unique objects. Normally using properties is recommended, e.g. myset[“key”] = true. However, I need the keys to be objects. I’ve read that Javascript casts property names to strings, so I gues…

Inmobi API for Javascript based mobile App

Has Inmobi provided API for Javascript based Mobile Application? I am writing Symbian apps using WRT (Web Runtime Widget). These apps are purely written in Javascript. Currently I am unable to find support for such apps from Inmobi. I have to integrate Inmobi ads in those apps. Is there any hack/solution avai…