Monday, November 29, 2010

Form field show/hide via JS

I'm working on an online credit app for a client and need to be able to add additional fields from a selected radio button.

Ex: There is a radio group that has two options, one is "Business" one is "Individual"
If someone clicks on Business, a text field for DBA needs to appear, If Individual is selected, DBA needs to be hidden.

Solution:

You need to set a onclick for each input radio to show or hide the additional input text.

Like:

input type="radio" name="type" value="Business" onclick="document.getElementById('dba').style.display='block';"

input type="radio" name="type" value="Individual" onclick="document.getElementById('dba').style.display='none';"

input type="text" name="dba" id="dba" value=""

Building Drag-and-Drop DIVs: Developing a Basic Script

# Building `Drag-and-Drop` DIVs: Developing a Basic Script
# Setting up the basics: emulating drag-and-drop triggers
# Dragging DIV elements: defining the “startDrag()” function
# Moving DIVs around the web document: defining the “dragDiv()” function
# Gluing the pieces together: defining the complete DIV dragging script

Full Tutorial

Sorting Elements by ID in javascript

So I have, say, a list of members that are sorted out on the page in sections, each section has its own id#. By default I want to display all of the IDs, but when someone selects a radio button I want only one section (id) to be shown.

Solution 1

First,

dom element id's can not be numbers (some frameworks will no work properly because of this)

that aside,

You want a list of all the id's in a javascript array, populate it however you want ..

var ids = new Array('id1','id2','id3','id4');
var current = 'id1'; // Currently shown member id

function switch($id) {
hide = new Array();
len = ids.length;
for(x=0; x< ele =" document.getElementById($id);" display =" '';" len =" arguments.length;" x="0;" ele="document.getElementById(arguments[x]);" display="none" in="" your="" radio="" buttons="">

input onclick="switch(this.value)" value="" type="radio"

Solution 2

If you know the ID of each section, and depending on the structure of your HTML tags, you can can loop through all the main tags within a section ( by #id ) and hide all except for the one that referred to by the radio butotn.

input onclick="single( 'item3', 'section1' )" value="" type="radio"

function single( id, sec )
{
var section = document.getElementById( sec );
var items = section.getElementsByTagName( 'li' );

for( var i=0; i < items.length ; i++ ) { items[i].style.display = ( items[i].id === id ) ? '' : 'none'; } }

Move the object using the Action Script and cursor.

Step 13

Then, select again the cursor, open the Action Script Panel (F9), and paste this script:

onClipEvent (load) {
}
onClipEvent (mouseMove) {
xm = getProperty (_root, _xmouse );
ym = getProperty (_root, _ymouse );
setProperty("_root.cursor", _x, xm);
setProperty("_root.cursor", _y, ym);
}

onClipEvent (mouseDown) {
with (_root.cursor) {
gotoAndStop("clench");
}
}

onClipEvent (mouseUp) {
with (_root.cursor) {
gotoAndStop("open");
}
}

We're done!

Full Tutorial

Move the Object using the arrow keys

Create a new layer and name it Action. Select it, click on the first frame, press F9 or select Window > Actions to open the Actions panel.

After that, enter the following ActionScript code inside the Actions panel:

information_txt.text = "Use your arrow keys to move the balloon!";
var speed:Number = 4;
object_mc.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
this._x = this._x+speed;
} else if (Key.isDown(Key.LEFT)) {
this._x = this._x-speed;
}
if (Key.isDown(Key.UP)) {
this._y = this._y-speed;
} else if (Key.isDown(Key.DOWN)) {
this._y = this._y+speed;
}
};

Action Script explanation:

1.information_txt.text = "Use your arrow keys to move the balloon!";
1. Display instructions on the screen

2 .var speed:Number = 4;
2. Set the speed for the object

3. object_mc.onEnterFrame = function() {
3. Capture the onEnterFrame event of the object_mc movie clip

4. if (Key.isDown(Key.RIGHT)) {
this._x = this._x + speed;
} else if (Key.isDown(Key.LEFT)) {
this._x = this._x - speed;
}

4. Move horizontally if the RIGHT or LEFT arrow keys are pressed

5. if (Key.isDown(Key.UP)) {
this._y = this._y - speed;
} else if (Key.isDown(Key.DOWN)) {
this._y = this._y + speed;
}
};

5. Move vertically if the UP or DOWN arrow keys are pressed

We're done!

Test your Movie (Ctrl+Enter).

Full Tutorial

Friday, November 26, 2010

Suggested Directory Organization

The FlexUnit 4 framework doesn’t prescribe a directory structure for testing files; however, the following suggestions work well:

  • Each test suite should have its own directory.
  • The suite definition should reside in this directory.
  • Within the directory for the test suite, create a tests directory.
  • Inside of this directory store each of your test cases for this test suite.
  • Any additional classes needed to accomplish testing can be stored in further subdirectories.

Ideally, the directory structure looks something like this

src/
testSuite1/
TestSuite1.as
tests/
TestCase1.as
TestCase2.as
TestCase3.as
testSuite2/
TestSuite2.as
tests/
TestCase1.as
TestCase2.as
TestCase3.as


Full Documentation

Thursday, November 25, 2010

5 Holiday Shopping Mistakes to Avoid

With the holiday season now in full swing, it's easy to get caught up in the hype and fall for a few expensive shopping mistakes. Sure, we all want to give our loved ones a holiday to remember, but there's no need to deck the halls with boughs of money to have a happy holiday.

[In Pictures: 12 Money Mistakes Almost Everyone Makes]

To help you stay off Santa's naughty list, here are five holiday shopping mistakes you make, and the fixes that can save you money.

Mistake 1: You don't have a gift list. If making a list and checking it twice is good enough for Santa, then stop being a Scrooge by skipping this important financial planning step. Running around the mall not knowing what to buy is a surefire path to blowing your budget--especially when you're pressed for time.

The Fix: Budget today for tomorrow's gifts by downloading this free Gift Giving Worksheet. As you think of gift ideas, just add them to the list with your expected budget.

Mistake 2: You don't track holiday spending. You spent how much on decorations, wrapping paper, and stocking stuffers? Ouch! Those little holiday spends can add up to a lot if you're not careful. Not tracking all those little splurges and expenses can leave you with a huge bill to pay in January. Not fun.

The Fix: Stay on the right financial track by using this free Holiday Expense Tracking Spreadsheet. There are a myriad of costs to keep in mind during the holidays, and it's easier to stay on budget when your spending list is up-to-date.

Mistake 3: You don't look for a discount. Paying full price for anything when a better deal can be found can turn any Santa into a Scrooge. Bah, Humbug! Many last minute shoppers are too desperate to find a deal when the big deadline looms.

The Fix: Avoid paying the price for not shopping around--go online and comparison shop before spending your hard-earned cash. Many retailers offer online promotional codes and coupons to savvy shoppers, so finding that deal is just a click away. Check out How to Find Big Savings with Secret Online Coupons for the best ways to save like Santa.

[Visit the U.S. News My Money blog for the best money advice from around the web.]

Mistake 4: You don't give homemade gifts. Buying packaged gift boxes, baskets, and other store-wrapped goodies is tempting, but expensive. Pre-made gift packages are sold for top dollar, and it's easy to make something special for far less. Besides, making something from scratch is thoughtful and can also save you money.

The Fix: You don't need to be a crafty or have a special skill to give a homemade gift this year. These 8 Homemade Gifts in a Jar are super simple--just layer tasty ingredients into a mason jar and add a gift tag. Need a hostess gift? Try baking a batch of tiny tarts (see How to Make Pie in a Jar) or make your own gift basket by adding a cookbook to a few recipe ingredients.

Mistake 5: You don't shop at home first. Filling your shopping cart with holiday decorations, gifts, and food supplies is a massive money mistake if you already have the goods at home. Buying stuff you already own adds clutter and costs money that could have been used to pay off your credit card or pay down your student loan.

The Fix: Take a peek in your pantry, open your closets, and search the basement before heading to the store. It's possible to deck out your home with everyday items to get that holiday feel. Check out 5 Ways to Decorate Your Holiday Table on a Budget for some stunning ideas.


Full Story

How to cope with being single during the holidays

The buildup to the holiday season begins early, that’s for sure. And if you’re used to being part of a pair strolling arm-in-arm through a winter wonderland, facing this time of year as a single person can really throw a wrench in your ho-ho-ho. The days ahead may seem anything but merry and bright.

“Holidays are hard because most of us have been conditioned to think that the season belongs to families and friends,” explains Bishop Noel Jones, pastor of the 20,000-member City of Refuge faith community in Gardena, CA. “The key to the torment of holiday blues is the conditioning based on our cultural upbringing. This has forged our minds into believing that we need someone with us to make the holiday joyful.” Jones, who's also the author of God’s Gonna Make You Laugh, continues: “This is endemic to our culture. It doesn’t matter whether you’re newly or ‘terminally’ single, the problem is being conditioned to believe it takes two to make holidays joyous.”

If you’re ready to begin reconditioning yourself for the single holiday season ahead, read on...

Adjust your attitude
Hard as it may be to imagine life after a breakup, there is one... assuming you choose it. Mark Rogers, a Dallas-based counselor and relationship coach, says it’s crucial to have a life. “Life’s supposed to be juicy and joyful,” he counsels. “So embrace your personhood, not your partnership status. If you don’t like your life, if your passions are all pastel, if your color’s washed out, your adventures listless, your hobbies hobbled, and your courage for new activities and novel interactions has dried up and blown away, then you may be hoping a romance will start blood flowing inside a turnip,” he says. (It won’t.)

“It’s not singlehood that’s a liability, it’s stagnation,” adds Rogers. “Get the juices flowing in your life, and then your relationship status becomes an attribute, not an identity.”

Think about it: the fun, interesting people you want to date want to date someone fun and interesting, too. “Get serious about being emotionally mature and interactionally interesting,” Rogers concludes. “Offer potential partners light-heartedness, passionate engagement with life, and a willingness to learn the dance steps of intimacy. That combination is practically irresistible.”

Use your network
“If you’re suddenly solo, you probably envision a holiday season spent sitting at home, watching It’s A Wonderful Life for the 45th time (this year),” laughs Jeanne Hurlbert, professor of Sociology at Louisiana State University. “But it doesn’t have to be that way. Focus on what you have — friends, family, colleagues — rather than what you lack. Enjoy those relationships fully. Choose to spend time with people who are fun and who will embrace your single status — not pity it — and will help you embrace it, too. Rekindle relationships with special people with whom you’ve lost touch. Renewing contact with old friends may provide a special holiday gift for both of you.”

Hurlbert also suggests hosting your own seasonal party to signal to yourself and your friends that you’re ready for a festive holiday. “Chances are, you’ll stimulate lots of invitations and activity,” she says. “And that will provide opportunities to expand your network.”

There are other ways to expand your social circle and fill that hole in your schedule. Join a new organization, or volunteer your time at a shelter or food bank. “Lots of organizations are looking for helping hands this time of year,” Hurlbert notes. “Providing that help will not only lift your mood, it will also introduce you to new people.”

Take care of yourself
While being a singleton can be a bummer, it does provide you with an opportunity to invest in your own well-being. “Taking time to unwind can decrease your stress levels and improve your health and relationships,” notes Mental Health America President and CEO David Shern. “Try meditating, exercising, engaging in a hobby or talking with a friend. It’s your time, so spend it doing something you enjoy.”

This is important because mental health is integral to our overall health and wellness. “Negative psychological factors, such as stress and depression, can have serious effects on physical health,” he explains. “Stress, for instance, is closely linked to high blood pressure, heart disease and obesity. Learning habits that promote mental health therefore helps us protect and strengthen our overall health and well-being.”

And if you feel good, you’ll look good. That will help your attitude stay positive — and make you more attractive to potential suitors.

No one’s saying it’s easy being suddenly single during the holidays. Nor are we saying it’s easy to change your attitudes and conditioning. But it is possible, with a little effort. And starting now, before the holiday crush is upon you, will make it easier. Who knows? If you develop a happy and healthy attitude about the holidays, you might just find love under the mistletoe!

Full Story

Tuesday, June 8, 2010

Dot Shot: Sinkhole in Guatemala City




This astonishingly unnerving photograph was posted today on the Flickr.com feed of the Guatemalan government and shows a seemingly bottomless sinkhole that opened up on Sunday in Guatemala City as a swath of Central America was drenched by tropical storm Agatha. Click here for the high-resolution version, if you dare. The storm only briefly hit tropical storm strength on Saturday as it came ashore from the Pacific Ocean over the weekend, but the death toll had risen to 115 at last count. Here’s a street-level view.

I heard about the image through the Twitter feed of Steve Silberman, a writer for Wired and other magazines. Here’s a lot of background on Florida’s many sinkholes.

President Álvaro Colom’s government has declared a state of public calamity in the Escuintla, Sacatepéquez and Guatemala departments, according to news agencies, in part because the Pacaya volcano near the capital erupted Friday, injuring many people and killing a television reporter.

Source: By ANDREW C. REVKIN

Video View of Guatemala Sinkhole



Just in case anyone had doubts about the reality of the extraordinary sinkhole that formed in a crowded district of Guatemala City — following a similar incident in the city in 2007 — this Associated Press video report closes the case. [There's more on Guatemala City's shaky underpinnings in the Daily Beast.]

By ANDREW C. REVKIN

Thursday, June 3, 2010

Latest Official Tally - 6/1/10 Presidential Canvassing; Pres. and VP may be Declared on June 7

Aquino-Binay Leading on Official Tally as of 7:37 pm, 6/1/10

Deep Hole In Guatemala

The Gates of Hell Just Opened In Guatemala

"This can't be real" was my first thought. Then I checked the source: The Guatemalan government. This sinkhole appeared last sunday in a street intersection of Ciudad de Guatemala. Just looking at the photo gives me vertigo.

Click on the images to see the high resolution version.

A sinkhole is a natural depression caused by the removal of underground soil by water. Usually, it happens when the substrate is formed by limestone, carbonate rock, salt beds or any other rock that is easily eroded by water streams. The process could be slow, but sometimes the land just cracks open without notice. In this case, it happened suddenly, swallowing an entire house. The cause: Massive underground water torrents created by tropical storm Agatha.

Sinkholes' size ranges from low terrain depressions to hundred of meters. Unlike the similar sinkhole that killed two teens in 2007, there seems to be no victims. At least one local newspaper is reporting one person dead, but the authorities have not confirmed it. Some neighbors claim that a whole three-story building and a house fell into the hole.



Source: gizmodo.com

Thursday, May 13, 2010

Free Web Hosting

Free cPanel Web Hosting with PHP5/Mysql - no advertising!
Register now: http://www.000webhost.com/306385.html

We can offer you a free web hosting package packed with advanced features for hosting & building professional dynamic websites. We provide secure free web space with all the web hosting tools you could possibly ever need.

Our package includes:
- 1500 MB of Disk Space, 100 GB Bandwidth
- Host your own domain (http://www.yourdomain.com)
- cPanel Powered Hosting (you will love it)
- Over 500 website templates ready to download
- Easy to use website builder
- Free POP3 Email Box with Webmail access
- FTP and Web based File Manager
- PHP, MySQL, Perl, CGI, Ruby.
- And many more..

Click here to visit us: http://www.000webhost.com/306385.html

Monday, May 10, 2010

HALALAN 2010: Latest Comelec official results

Posted at 05/10/2010 11:26 PM | Updated as of 05/11/2010 1:46 AM

The latest partial official results of the May 10, 2010 National Elections from the Commission on Elections (Comelec).

Updated: 00:50 Philippine Standard Time, May 11, 2010.


PRESIDENT VOTES
AQUINO 10,137,173
ESTRADA 6,413,712
VILLAR 3,476,693
TEODORO 2,660,865
VILLANUEVA 767,615
GORDON 378,247
PERLAS 33,858
MADRIGAL 30,536
DELOS REYES 28,102

VICE PRESIDENT VOTES
BINAY 10,072,980
ROXAS 9,239,205
LEGARDA 2,603,832
FERNANDO 720,791
MANZANO 455,325
YASAY 248,232
SONZA 41,774
CHIPECO 31,621

Updated: 23:11 Philippine Standard Time, May 10, 2010.

SENATORS VOTES
REVILLA 11,622,707
ESTRADA 11,577,545
DEFENSOR-SANTIAGO 10,664,143
DRILON 9,777,874
ENRILE 9,673,563
CAYETANO 8,496,807
MARCOS 8,349,399
RECTO 7,588,912
SOTTO 7,435,186
OSMENA 7,055,021
LAPID 6,547,022
GUINGONA 6,349,249
HONTIVEROS-BARAQUEL 5,746,130
BIAZON 5,375,657
DE VENECIA 5,165,124
REMULLA 4,695,661
LIM 4,592,207
ROCO 4,154,386
QUERUBIN 4,088,669
PIMENTEL 3,778,893
ACOSTA 3,577,222
LACSON 3,117,843
TAMANO 2,474,286
MAZA 2,369,680


Data from the Commission on Elections

Saturday, April 3, 2010

AKALA MO Manny Villar Latest TV Advertisement

MAR ROXAS TV "CAMPAIGN" ADVERTISEMENTS Parodised by CCKMA in HD


Source: http://wonderpinoy.blogspot.com

Noynoy and Lapid

Special Olympics

Broke back presidentiables 2010

The Proposal

Source: pinoyexchange.com

Glorias Basterd


Source: pinoyexchange.com

THE JACKSON 5

JAMBY IN THE PALACE

LILO and STITCH

Source: pinoyexchange.com

RaRa Ah-ah-ah Roma, Romama!

Naka ligo ka na ba sa dagat ng basura?

Boys Over Loren

20091016111010660_boysoverloren_front

Source: noypitayo.com

Yan ang tanong namin tunay ka bang isa sa 'min'?!



Source: pinoyexchange.com

landas ng Pagbabago


BITCH?


Source