View Full Version : Email form, button with If statement
Dave
September 9th, 2003, 10:21 AM
I have this email form. Click on the bottom where it says submit track.
It takes you to a form section.
On that button i have an if statement, but it doesnt work.
I only want the playhead to play when all 3 fields have been filled out, i thought i had it right, but i was wrong :m:
And i dnt want the playhead to go anywhere if it hasnt been filled.
Anyone?
:hair:
Thanks
Dave
September 9th, 2003, 10:22 AM
forgot
.soulty
September 10th, 2003, 12:47 AM
Bump ;)
I've tried figuring this out, confusing. :h:
on (press) {
if (sender_title ne "" and sender_artist ne "" and party_location ne "") {
stop();
} else {
play();
}
}
Ive read that ne has been replaced in flash 5 and above to equality "==" and inequality "!=" operators, and also trying "&&" instead of "AND" don't seem to work.
.soulty
September 10th, 2003, 12:56 AM
If ne is the same as != isent that not equal to.
so wouldnt the code be
on (press) {
if (sender_title == "" and sender_artist == "" and party_location == "") {
stop();
} else {
play();
}
}
Digitalosophy
September 10th, 2003, 01:17 AM
on(press){
if(!sender.length){
stop();
}else{
play();
}
}
etc...
.soulty
September 10th, 2003, 01:36 AM
ok kool, its working , but it allows you to send when only one field has been entered. how would you prevent this? only to send when 3 fields are filled up.
.soulty
September 10th, 2003, 02:34 AM
ok got it working,
on (press) {
if (!sender_title.length + !sender_artist.length + !party_location.length) {
stop();
} else {
play();
}
}
.soulty
September 10th, 2003, 05:05 AM
hey dave, that code you posted got me intrested , if you want, read through, In a String why "+" and not "&&" thread .
heres the updated code for the email form
on (press) {
if ((sender_title.length && sender_artist.length) && (party_location.length)) {
play();
} else {
stop();
}
}
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.