Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple Javascript Question



It sounds like your looking for how to access the value of the textbox from javascript.

This is fairly simple, especially if you put an id element on the textbox. Just use

document.getElementById('yourTextBoxId').value

If that's not what you're looking for, please be more specific.

On Jan 11, 2007, at 1:10 PM, Mark Delfs wrote:

How would I do an if-then statement from the contents of a text box on a widget?

For example, my script runs and populates a text field with the words "Passed Test" I want to have the widget change a graphic based on what this text box says---if the contents of that text box say "Passed Test" then I want to have the widget change the graphic to a green version of the graphic. Then, if the text box says "Failed Test," I want it to turn the graphic to a red version. The current line of code will change the graphic regardless of what the box is saying--I don't have the code at my fingertips at the moment, but, the rest of the script works great except for when it's supposed to read a text box, decide what it says and change a graphic accordingly.

Please help if you can, I'm very new to Javascript!




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/errolbert% 40mac.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Dashboard-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >Simple Javascript Question (From: "Mark Delfs" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.