Alarm the users about the specific fields that are not null,

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Alarm the users about the specific fields that are not null,

Postby akalehzan » Tue Jun 22, 2004 7:47 pm

Hi All,


In Servoy form IM-^Rm trying to alarm the users about the specific fields that are not null, and ask them to fill the fields with the following:
Teach, Father, Mother or Other.

I have the following JavaScript that is not working form me:

var alert = '';
// from the form abc_respondent
if (abc_respondent == "")
{
// If null display and alert box
alert("Please fill in the field with Mother, Father, Teacher or Other.");
// return false to stop further processing
return (false);
}
// If abc_respondent is not null continue processing
return (true);


plugins.dialogs.showInfoDialog( 'Result', alert, 'OK')


Please advise.

Thanks,

Abarhim
akalehzan
 
Posts: 267
Joined: Mon Mar 29, 2004 8:15 am
Location: Stanford

Postby stephan » Tue Jun 22, 2004 10:32 pm

Try:

Code: Select all
if (abc_respondent == null || abc_respondent == "")  {
    // do this
}
stephan
 
Posts: 76
Joined: Thu Jun 03, 2004 3:30 pm

Postby Harjo » Tue Jun 22, 2004 10:40 pm

Try this:
Code: Select all
var alert = ''";
if (Teacher == "" || Father == "" || Mother == "" || Other == "")
{
     alert = "Please fill in the field with Mother, Father, Teacher or Other.";
}
else
{
     alert = "BINGO! You filled everything just right!";
}
plugins.dialogs.showInfoDialog( 'Result', alert, 'OK')
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 32 guests

cron