Page 1 of 1

create client side javascript alert in php

Posted: Wed Apr 01, 2009 10:05 pm
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

Re: create client side javascript alert in php

Posted: Thu Apr 02, 2009 12:13 pm
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.