• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: WO/Javascript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: WO/Javascript


  • Subject: Re: WO/Javascript
  • From: Tom Woteki <email@hidden>
  • Date: Thu, 6 Jan 2005 23:05:27 -0500

Here is a sketch, and only a sketch from memory (and there are alternatives):

Add a new binding to your form's submit button:

onclick="return hasEmailAddress( this.form );"

"this" is a reference to the button, form is a reference to the form in which it is embedded

Prepare a javascript:

function hasEmailAddress( aForm ) {
	return aForm.nameOfYourEMailAddressField != null;
}

"nameOfYourEMailAddressField" is whatever value you you care to assign to the email address field in your form using the "name" tag of that field. Since you are passing in the form, you can check as many fieilds as you like this way.

Embed that javascript in the html of your page. You can use a WOJavaScript component embedded in the <head> section of the page or elsewhere. There are other ways.

Or something like the above.... YMMV,

Tom


On Jan 6, 2005, at 11:06 AM, Sébastien Gruhier wrote:

Hello

I am a little bit lost with WO and Javascript.
I have a page with a form and some textfields. Some of them are mandatory. When the user submti the form, it calls an action. In this action I check if mandatory fields are not empty. If they are, I would like to popup a small window, saying "you need to type your email" for example.
How do I do this? I saw some JSxxxx class but I don't understand how to use them.


Any sample code or hints to do that?
Seb

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >WO/Javascript (From: Sébastien Gruhier <email@hidden>)

  • Prev by Date: Re: How to Auto Login from Remote Site?
  • Next by Date: Re: [OT] can you develop Active Server Pages on OS X?
  • Previous by thread: Re: WO/Javascript
  • Next by thread: Re: WO/Javascript
  • Index(es):
    • Date
    • Thread