How to allow input text field to accept more than one "specific" answer.
Hi,
I am working for something and trying to create a type-box-based quiz for one of my classes, where an input text field can change it's border color if 2 or more words from an accepted word list is inputed.
For example, Say a list has possible answers: R,G, B, Y for the question "Name 2 colors".
I want to create an input text box where the border of the box will change color if any 2 letters (in the above list) are entered into it.
I've tried setting up a variable NumberSuccesses and setting it so that the number increases by 1 for each letter entered e.g.
if (Ex.text == "R");
NumSuc = NumSuc +1; // the var NumSuc has already been defined earlier in the code
If (Ex.text ''G")
NumSuc = NumSuc + 1
if (NumSuc == 2)
Ex.borderColor = 0x0000FF
but that didn't work.. and I tried doing it with another function which I use for multiple input boxes like if there were boxes A, B, C. I could set up a general function where if the correct answers were entered into A, B, an C respectively, only then will say, a checkmark show up using a
EnableCheckmark (); type function. Not sure how to do it if it's the same text input box though. Also just tried adding it into the same function re.
If (Ex.text == "R" + "G")
Ex.borderColor = 0x0000FF
.. Does anyone know what else I can do?
The solution of Nishu with Evaluation Logic:
//These Are the Possible Answers
var solutions:Array = new Array("A","B","C","D");
function testInput(_inputText:String):Boolean
//the delimiter could also be a comma, here it is a space
var inputStringArray:Array = _inputText.split(" ");
var counter:Number = 0;
for (var i:int=0; i<inputStringArray.length; i++)
for (var j:int=0; j<solutions.length; j++)
if (inputStringArray[i]== solutions[j])
counter++;
if (counter >=2)
trace("true");
return true;
else
trace("false");
return false;
//Textfield with name input_txt on stage
input_txt.addEventListener(TextEvent.TEXT_INPUT, answerTxtInp);
// The function that will be called by the event listener
function answerTxtInp(txtEvent:TextEvent):void
// depending on the possible answers of characters, change the border color
if(testInput(input_txt.text)){
input_txt.borderColor = 0xFF0000;
else{
input_txt.borderColor = 0x000000;
Similar Messages
-
Shell script how getopts can accept more than one string in one var
In shell script how getopts can accept more than one string in one variable DES
Here is the part of shell script that accepts variables from the Shell script but the DES variable does not accepts more than one variable., how to do this ??
When i run the script like below
sh Ericsson_4G_nwid_configuration.sh -n orah4g -d "Ericsson 4g Child" -z Europe/Stockholm
it does not accepts "Ericsson 4g Child" in DES Variable and only accepts "Ericsson" to DES variable.
how to make it accept full "Ericsson 4g Child"
========================================
while getopts “hn:r:p:v:d:z:” OPTION
do
case $OPTION in
h)
usage
exit 1
n)
TEST=$OPTARG
z)
ZONE="$OPTARG"
d)
DES="$OPTARG"
v)
VERBOSE=1
usage
exit
esac
donePlease use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Fo … s_and_Code
Also, see http://mywiki.wooledge.org/Quotes -
How to resrict purchaser accept more than one RFx response ?
hi all
we use SRM 7.0 with standalone scenario.
when the purchaser carry out Response comparison , system permit purchaser accept more than one bidder for one RFx item . the result is we want material A 10 piece, but supplier X and supplier Y get PO for 10 piece material A each.
we want to restrct this operation, please give me some advices, thanks.
regards
claudYou might want to try restricting at the PO creation time. Implement BBP_DOC_CHANGE_BADI for PO (BBP_PO_CHANGE method). In the logic, check the related proceeding RFx's item total quantity against its existing follow-on POs' item quantity. If adding the quantity of the current PO exceeds the total RFx item quantity, throw an error to prevent the current PO from being created.
-
How can I use my iPod nano on more than one computer?
How can I use my iPod nano on more than one computer?
Hi, China6450.
Thank you for visiting Apple Support Communities.
I would recommend setting up Manually manage music. This will only allow music to be synced from the computer to the iPod nano. Here are some helpful articles that will walk you through the process.
Managing content manually on iPhone, iPad, and iPod
http://support.apple.com/kb/HT1535
Using iPhone, iPad, or iPod with multiple computers
http://support.apple.com/kb/HT1202
Cheers,
Jason H. -
Dileama: Does my server accept more than one client
i created a simple server and a client app. but i am unable resolve wether the server is going to accept more than single client. if not, then should i implement threads to accept more than one client on my server.
i created a simple server and a client app. congrats!
but i am unable resolve wether the server is going to accept
more than single client. Not sure what you mean here.... Do you mean "Should I allow it to accept more than one client at a time?" If so, then that's up to you, isn't it?
if not, then should i implement threads to accept more than
one client on my server.If so, you mean. Yes, if you want multiple clients to connect, you have the server socket accept the socket connection from the client and pass that socket to a new thread which handles the connection, then the server socket would be free to accept another connection.
I'm only familiar with the old I/O package, not the New I/O stuff, so this is a bit old school:
ServerSocket ss = new ServerSocket(1234);
while(true) {
Socket s = ss.accept();
newClient(s);
private void newClient(final Socket s) {
Thread t = new Thread() {
public void run() {
try {
BufferedReader in = new BufferedReader(new InputStreamReader(s.getInputStream()));
PrintWriter out = new PrintWriter(new OutputStreamWriter(s.getOutputStream()));
out.println("yes? what is it?");
out.flush();
String line;
while((line = in.readLine()) != null) {
out.println("ha ha, you said '" + line + "'");
out.flush();
} catch(Exception e) {
try {
s.close();
} catch(Exception e) {
t.start();
} -
How to select a substring in oracle up to a more than one specific character
How to select a substring in oracle up to a more than one specific character
for ex : 121.051^NP: FAMILY PRACTICE ( trim the values before ^ )
121.051^*NP: FAMILY PRACTICE (trim the value before *).
with below function I can only get rid of ^ , I want both the specific characters ^ and ^* to be removed at the same time.
SUBSTR(p.phys_sub_grp_2_desc,INSTR(p.phys_sub_grp_2_desc, '^') +1)Another option is to boldly replace 'em:
SQL> with t as (
2 select '121.051^NP: FAMILY PRACTICE' str from dual union
3 select '121.051^*NP: FAMILY PRACTICE' from dual
4 )
5 --
6 -- actuel query:
7 --
8 select substr( replace(str, '*')
9 , instr(replace(str, '*'), '^')+1
10 ) str
11 from t;
STR
NP: FAMILY PRACTICE
NP: FAMILY PRACTICE
2 rows selected. -
How to find out which sub query returns more than one row
Hi all,
Can any one give me clue ,how to find out which sub query returns more than one row in the following query .
/* Formatted on 2011/05/17 19:22 (Formatter Plus v4.8.8) */
SELECT a.*, ROWNUM AS rnm
FROM (SELECT DISTINCT '1' AS "Page View", ou.org_unit_name AS "Org",
prxm.mbr_idntfr AS "Beneficiary ID",
md.last_name
|| ', '
|| md.first_name AS "Beneficiary Name",
pci.idntfr AS "Tracking No.",
TO_CHAR (TRUNC (req.pa_rqst_date),
'MM/dd/yyyy'
) AS "Request Date",
sts.status_name AS "Status",
req.pa_rqst_sid AS "Request #",
prxm.mbr_sid AS "Mbr_sid",
TO_CHAR
(TRUNC (req.pa_revision_date),
'MM/dd/yyyy'
) AS "Last Updated",
TO_CHAR (psd.TO_DATE, 'MM/dd/yyyy') AS "TO_DATE",
prxpl.prvdr_lctn_iid AS "PRVDR_LCTN_IID",
pd.prvdr_sid AS "PRVDR_SID", 'Y' AS "State View",
DECODE
((SELECT DISTINCT pd.national_prvdr_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid =
req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
0, (SELECT prxplo.prvdr_lctn_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
NULL, (SELECT prxplo.prvdr_lctn_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
(SELECT DISTINCT pd.national_prvdr_idntfr
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid =
req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR')
) AS "NPI/ID",
DECODE
((SELECT pd.org_bsns_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
NULL, (SELECT pd.last_name
|| ', '
|| pd.first_name
|| ' '
|| pd.middle_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR'),
(SELECT pd.org_bsns_name
FROM pa_request_x_provider_location prxplo
WHERE prxplo.pa_rqst_sid = req.pa_rqst_sid
AND prxplo.oprtnl_flag = 'A'
AND prxplo.pa_prvdr_type_lkpcd = 'RR')
) AS "Prvdr Name",
TO_CHAR (psd.from_date,
'MM/dd/yyyy'
) AS "Srvc From Date",
TO_CHAR (req.validity_start_date,
'MM/DD/YYYY'
) AS "Due Date",
(fn_get_busniess_days (TRUNC (req.validity_start_date))
) AS "Days<br>Left",
req.pa_mode_type_lkpcd AS "Source",
TO_CHAR (TRUNC (wmdtl.rtng_date),
'MM/dd/yyyy'
) AS "Assigned On",
NVL (wmdtl.assigned_to_user_name,
'Not Assigned'
) AS "Assigned To",
req.org_unit_sid AS "OrgUnitSid",
TO_CHAR
(wmdtl.modified_date,
'MM/dd/yyyy hh24:mi:ss'
) AS "WTRD_MODIFIED_DATE",
TO_CHAR (wmdtl.rtng_date,
'MM/dd/yyyy'
) AS "WTRD_RTNG_DATE",
req.status_cid AS "PA_STATUS_CID",
TO_CHAR (req.modified_date,
'MM/dd/yyyy'
) AS "PA_REQ_MODIFIED_DATE",
prs.state_pa_srvc_type_code
AS "STATE_PA_SRVC_TYPE_CODE",
wmdtl.wm_pa_task_rtng_dtl_sid
AS "WM_TASK_RTNG_DTL_SID",
wmdtl.assigned_to_user_acct_sid
AS "WTRD_Assigned_to_user_acct_sid",
(fn_get_busniess_days (TRUNC (req.validity_start_date))
) AS "Days<br>LeftSort",
wmdtl.assigned_to_org_unit_sid
AS "WTRD_Assigned_to_OrgUntSid",
DECODE
((SELECT COUNT (*)
FROM pa_request_status prs
WHERE prs.pa_rqst_sid = req.pa_rqst_sid
AND prs.status_cid = 5
AND prs.oprtnl_flag = 'I'),
0, 'N',
'Y'
) AS "SHOW_UTILIZATION"
FROM pa_request req,
pa_certification_identifier pci,
status sts,
pa_request_x_member prxm,
wm_pa_task_routing_detail wmdtl,
pa_service_date psd,
org_unit ou,
pa_request_service prs,
pa_request_x_provider_location prxpl,
provider_location pl,
provider_detail pd,
provider p,
mbr_dmgrphc md
WHERE req.oprtnl_flag = 'A'
AND req.status_cid NOT IN
(20, 30, 70, 25, 80, 96, 85, 5, 97, 98, 101)
AND req.org_unit_sid IN
(3057, 3142, 3058, 3143, 3059, 3144, 3060, 3145,
3061, 3146, 3062, 3147, 3063, 3148, 3064, 3149,
3065, 3150, 3066, 3151, 3067, 3152, 3068, 3153,
3069, 3154, 3070, 3155, 3071, 3156, 3072, 3157,
3073, 3158, 3074, 3159, 3075, 3160, 3076, 3161,
3077, 3162, 3078, 3163, 3079, 3164, 3080, 3165,
3081, 3166, 3082, 3167, 3083, 3168, 3084, 3169,
3085, 3170, 3086, 3171, 3087, 3172, 3088, 3173,
3089, 3174, 3090, 3175, 3091, 3176, 3092, 3177,
3093, 3178, 3094, 3179, 3095, 3180, 3096, 3181,
3097, 3182, 3098, 3183, 3099, 3184, 3100, 3185,
3101, 3186, 3102, 3187, 3103, 3003, 75000104,
75000108, 2006, 75000103, 75000102, 75000113,
75000111, 75000109, 2001, 2009, 75000105,
75000107, 2004, 2010, 2013, 2014, 2005, 2011,
75000112, 2002, 1001, 2012, 75000106, 2007,
75000101, 2003, 75000110, 2008, 3001, 3002, 3019,
3104, 3020, 3105, 3021, 3106, 3022, 3107, 3023,
3108, 3024, 3109, 3025, 3110, 3026, 3111, 3027,
3112, 3028, 3113, 3029, 3114, 3030, 3115, 3031,
3116, 3032, 3117, 3033, 3118, 3034, 3119, 3035,
3120, 3036, 3121, 3037, 3122, 3038, 3123, 3039,
3124, 3040, 3125, 3041, 3126, 3042, 3127, 3043,
3128, 3044, 3129, 3045, 3130, 3046, 3131, 3047,
3132, 3048, 3133, 3049, 3134, 3050, 3135, 3051,
3136, 3052, 3137, 3053, 3138, 3054, 3139, 3055,
3140, 3056, 3141)
AND req.pa_rqst_sid = prs.pa_rqst_sid
AND prs.oprtnl_flag = 'A'
AND prs.pa_rqst_srvc_sid = psd.pa_rqst_srvc_sid
AND psd.oprtnl_flag = 'A'
AND req.pa_rqst_sid = pci.pa_rqst_sid
AND pci.oprtnl_flag = 'A'
AND req.pa_rqst_sid = prxm.pa_rqst_sid
AND prxm.oprtnl_flag = 'A'
AND md.oprtnl_flag = 'A'
AND md.status_cid = 2
AND TRUNC (SYSDATE) BETWEEN md.from_date AND md.TO_DATE
AND prxm.mbr_sid = md.mbr_sid
AND ou.org_unit_sid = req.org_unit_sid
AND ou.oprtnl_flag = 'A'
AND req.pa_rqst_sid = prxpl.pa_rqst_sid
AND prxm.pa_rqst_sid = prxpl.pa_rqst_sid
AND pci.pa_rqst_sid = prxm.pa_rqst_sid
AND pci.pa_rqst_sid = wmdtl.subsystem_task_sid
AND pci.pa_rqst_sid = prxpl.pa_rqst_sid
AND prxpl.pa_prvdr_type_lkpcd = 'RR'
AND prxpl.oprtnl_flag = 'A'
AND req.status_cid = sts.status_cid
AND sts.status_type_cid = 3
AND sts.oprtnl_flag = 'A'
AND prxpl.prvdr_lctn_iid = pl.prvdr_lctn_iid
AND p.prvdr_sid = pd.prvdr_sid
AND p.prvdr_sid = pl.prvdr_sid
AND pd.oprtnl_flag = 'A'
AND pd.status_cid = 2
AND TRUNC (SYSDATE) BETWEEN pd.from_date AND pd.TO_DATE
AND wmdtl.subsystem_task_sid = req.pa_rqst_sid
AND wmdtl.subsystem_lkpcd = 'PA'
AND wmdtl.oprtnl_flag = 'A'
AND req.pa_rqst_date > (SYSDATE - 365)
ORDER BY TO_DATE ("Request Date", 'MM/dd/yyyy hh24:mi:ss') DESC,
"Beneficiary Name" ASC) a
WHERE ROWNUM < 102;regards,
P Prakash
Edited by: BluShadow on 17-May-2011 15:01
added {noformat}{noformat} tags around the code833560 wrote:
Can any one give me clue ,how to find out which sub query returns more than one row in the following query .This is why smaller, simpler queries are easier to work with than huge ones - when something like this goes wrong smaller queries are much eaiser to debug. Unfortunately using smaller, easier-to-work with queries is not always an option
Ganesh is right - you will have to dissect the big query bit by bit until you find the offending subquery. If there is another way I would like to find out about it too.
The easiest way to do this is probably to use block comments to isolate parts of the query bit by bit until you find the offending part. If you carefully examine the subqueries you might be able to figure out which one is returning multiple rows without commenting everything
Good luck! -
How can i get apple tv2 to recognize more than one computer in my house
how can i get apple tv2 to recognize more than one computer in my house, I just got it and can only find one of two computers in my home
Same here. I have 1 ATV2 and 2 computers and each has separate iTunes accounts (mine and my wife's). The ATV menu says "computers" so I presume you can have more than 1 computer on 1 ATV. The big question is how do you set it up?
-
HT203433 How do I find out if I have more than one apple id
How do I find out if I have more than one id
You'll have to use your little gray cells on this one. How can anyone know if an apple ID belongs to you? There's no way to identify you.
-
How do i set text alerts to sound more than twice on iPhone 6 plus?
How do I set my text alerts to sound more than twice on my iPhone 6 Plus?
Settings > Notification Center > Messages > Repeat Alerts. Choose between never or up to 10 times.
-
Post Author: DennisC
CA Forum: General
I am creating a report that is to be grouped on a particular field that can have more than one entry. My user said they did not care how I did it but to only count the record one time. The field that is selected is a dropdown on an form that is in Alpha order. So the entries always appear in the the field in alpha order. This is for use as an example: Record 1 has a value of CAT in the field, Record 2 has a value of CAT, DOG in the field and Record 3 has a value of CAT, DOG, HORSE in the field. I get 3 separate groupings for the 3 records.
Group = CAT
Then the detail information appears here
Group = CAT, DOG
Then the detail information appears here
Group = CAT,DOG,HORSE
Then the detail information appears here
What is would like to see using this example is one group for CAT with all 3 records appearing under it and ignore the other two. This way there would all be getting counted but the report would look a little more streamlined.
Group = CAT
record 1 detail information
record 2 detail information
record 3 detail information
thanks in advanced for any help!!!!Post Author: shawks
CA Forum: General
I am trying resolve the same/similar issue in Crystal Reports 10. For example, on a table there is a column called X with values Xsub1, Xsub2, Xsub3, etc. The user can select a parameter that includes Xsub2 and Xsub4. If this is selected 2 reports are generated (one for Xsub2 and Xsub4). What we really want is one report with the combined information for Xsub2 and Xsub4. How is (or is it) possible to do this in Crystal Reports 10? FYI - When the report was initially created the main body of the report was placed in the Group Footer so if the Group Footer is suppressed the content of the report is suppressed, too.
Thanks -
SELECT INTO SELECT CAN IT ACCEPT MORE THAN ONE LINE ?
Hi i have a table that i have to fill with information from an old one, but there are two colomns that i have to fill with another table. So here is the select that i will use with the insert part.
select
id_migration_mig,
(select a.id_instance_ins
from gdiexp.t_instance a, gdiprod.t_migration_detail b, gdiexp.t_bd c
where a.id_instance_ins = c.id_instance_ins and c.id_base_donnee_bd = b.id_instance_ins_actuelle),
(select a.id_instance_ins
from gdiexp.t_instance a, gdiprod.t_migration_detail b, gdiexp.t_bd c
where a.id_instance_ins = c.id_instance_ins and c.id_base_donnee_bd = b.id_instance_ins_cible),
type_environnement,
date_migration,
donnees_sources,
date_au_plus_tot,
methode,
date_dern_maj_ctrl,
code_usager_ctrl
from gdiprod.t_migration_detail;
problem is that this gives me a ORA-01427: single-row subquery returns more than one row. How can i solve that ? Thanks.Your queries in the select clause need to be correlated witt the rows you are selecting from gdiprod.t_migration_detail. You should not need to have gdiprod.t_migration_detail in those queries. I believe that you need something more like:
select id_migration_mig,
(select a.id_instance_ins
from gdiexp.t_instance a, gdiexp.t_bd c
where a.id_instance_ins = c.id_instance_ins and
c.id_base_donnee_bd = md.id_instance_ins_actuelle),
(select a.id_instance_ins
from gdiexp.t_instance a, gdiexp.t_bd c
where a.id_instance_ins = c.id_instance_ins and
c.id_base_donnee_bd = md.id_instance_ins_cible),
type_environnement, date_migration, donnees_sources, date_au_plus_tot,
methode, date_dern_maj_ctrl, code_usager_ctrl
from gdiprod.t_migration_detail md;You query, and my re-written version are essentially outer joins, and could be re-written as such. If you are sure that there will always be a match, that is, when oyu insert into your table, the columns populated by the scalar queries are never null, then it could (and probably should) be re-written as a equi-join.
John -
How to use the same credit card for more than one customer master
Hi,
this is a question for consultants at least a little familiar with SAP business partner, Customer-vendor-intergration cvi, contract accounting:
My customer wants to store the same credit card with more than one customer. Arguments are that family members or partners may mutually agree to use the same credit card for their distinct purchases.
I never tried with amazon or the likes but I know that SAP validates the uniqueness of credit cards.
I found 6 code line where the message (V/)005 "Payment card &1 &2 is already assigned to customer &3" prohibits duplicate assignment.
Even if I create a couple of enhancements to suppress the error, I don't know how the system will work.
The customer does not like the idea of using alternative payer.
Did you ever face the same problem and how did you solve it?
Much Thanks in advance
Best regards
Clemensthanks
-
How do i send a gift card to more than one person
HOW DO I SEND MORE THAN ONE GIFT CARD AT A TIME PLZ HELP IM DYING
Repeat the process for each gift card. They must be sent independently as they are sent to different person.
-
How to read a tiff file that has more than one page?
Hi,
I use JAI to read TIFF image and get the pixels from a raster object. A TIFF file can have more than one image in itself. The JAI doc from SUN only mentioned that we can get the number of IFD (image file directory) by using
getNumDirectories() function but no description about how to get different images separately out of one TIFF file. Does any one know how to do it or some example programs implementing such function? Thanks a lot.
MarvinI'm not sure if this helps, but here's a web page which talks about Image I/O:
http://java.sun.com/products/java-media/jai/iio.html
For your problem, they have a sample solution which can read a specific page of a multi-page tiff file, so perhaps you could make a loop to read all of the pages:
http://java.sun.com/products/java-media/jai/forDevelopers/samples/MultiPageRead.java
Good luck!
Maybe you are looking for
-
HT1296 itunes won't sync my audio files after I upgraded my iphone to i0S 6
I upgraded my phone to iOS 6 for the new features and could no longer play (or find) my audio books. The disk space usage indicated that the files were still there but the music player would not show or play them. I try to sync to iTunes Library an
-
How to Identify mismatch values in two columns
I have two tables basically two excel files used by two different depts. I am trying to reconcile dollar amounts between two. Table A has ID, Amount,Paid Date Table B has ID,Amount ,Paid Date. What`s happening is between two tables at times we are fi
-
CF DSN 'loses track' of tables and views
... but only in one database and only at a certain time (around 8am). We have a manual solution, Open the DSN and switch the server name to Network alias or vice versa and save - but why does this work? Ae we refreshing the connection pool? I've incr
-
Error when trying to iChat with AIM Buddy with 10.4.11 - Any Thoughts?
Connecting with IChat and AIM Buddy who is on a PC. The buddy invites me and I accept. It tries to start but it will not connect.
-
CS-5 Workspace question.
In all previous versions of Photoshop, when opening an image file, the image would extend over to the edge of the Palettes, as did Ctrl+0/ full screen. In CS-5, the image extends out-- under the Palletes. Is there a setting to have the image stop at