create client side javascript alert in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
greedyisg00d
Forum Commoner
Posts: 42
Joined: Thu Feb 12, 2009 2:48 am

create client side javascript alert in php

Post by greedyisg00d »

I have 2 date fields namely date_from and date_to. A javascript alert pops out when date_from is ahead of date_to for example

date_from: 2009-04-25 //Error date_from is greater than date_to
date_to: 2009-04-11

What I want is to create a validation using javascript alert whenever the user clicks on the submit button. Sample codes is much appreciated

Thanks
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: create client side javascript alert in php

Post by pickle »

- You'll want to use the onclick event handler()
- How is this related to PHP? Unless you're using AJAX, this is strictly client-side & I can move it to that forum
- Straight-up asking for code will likely get you nowhere. Show us what you've tried & specifically what the problem is.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply