alert box popup from form onsubmit

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
edzillion
Forum Newbie
Posts: 12
Joined: Mon Jan 28, 2008 10:06 am

alert box popup from form onsubmit

Post by edzillion »

I am trying to replicate the functionality of a form on a webpage, and I need some help.

Code: Select all

 <form id="form1" onsubmit="return validateFormOnSubmit(this)" 
 name="updates" method="post" action="market_update_FV.php">
When the form is submitted with incorrect data an alert box is popped up in the browser window:

Image

How do you do this?
Also, is validateFormOnSubmit() a php function? I didn't know that a function could be called in the file in the action= field...

TIA
Ed
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: alert box popup from form onsubmit

Post by yacahuma »

no, that is a javascript function.

in you validate you will use alert()
edzillion
Forum Newbie
Posts: 12
Joined: Mon Jan 28, 2008 10:06 am

Re: alert box popup from form onsubmit

Post by edzillion »

thanks
Also, the 'this' pointer in validateFormOnSubmit(this), what type is it?
How to deal with this in the javscript function declaration?

Ed
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Re: alert box popup from form onsubmit

Post by yacahuma »

Post Reply