/    Sign up×
Community /Pin to ProfileBookmark

Regular expressions and buttons help required

Thanks a lot,

Alistair

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterMar 23.2006 — I don't see even a single regular expression in your code.

This is an example Regular Expression for validating dates (Written by Juuitchan).
<i>
</i>&lt;script type="text/javascript"&gt;
var j=new RegExp("(((0[1-9]|[12][0-9]|30)/(0[13-9]|1[012])|(31/(0[13578]|1[02]))|((0[1-9]|1[0-9]|2[0-8])/02)))/[0-9]{4}|(29/02/(([02468][048]|[13579][26])00|[0-9]{2}(0[48]|[13579][26]|[2468][048])))")
alert(j.test("29/02/2000"))//true
alert(j.test("29/02/3000"))//false
&lt;/script&gt;
Copy linkTweet thisAlerts:
@AlistairauthorMar 23.2006 — Thanks,

Alistair
Copy linkTweet thisAlerts:
@AlistairauthorMar 24.2006 — All appreciated,

Alistair
Copy linkTweet thisAlerts:
@konithomimoMar 24.2006 — Give your form a name. By using document.form you are messing up the browser.
Copy linkTweet thisAlerts:
@AlistairauthorMar 24.2006 — This has now been solved and can be closed,

Alistair
×

Success!

Help @Alistair spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...