How can I retrive Checkbox Values from a Text File..?

Oh… I forgot to say this…

Do not take my word word for word… You gotta understand why I am giving you the code… Try to understand why you should use that particular code first… You should apply the code only when you understand what you need to do… Know what I mean???

yeh i did a whole bunch of research on the web, and sendAndLoad will work i fgure, cause I am sending the store number getting a the string and if it’s correct and the store number exists then It will load up all the variables as u helped me, the DOTS and check boxes.

hey though if the store number is invalid, i have my asp script what would u recommend so they get an Error?
sayihng please enter new number?

so i do a Trace?
or something?

hey though if the store number is invalid, i have my asp script
Um… What do you mean???

well in my asp page, I have an IF else IF statment
and if the number is invalid it will return a message to
the Flash Movie, through a dynamic box field

do i have to do a trace?or something maybe? or no?

ok u might hate me after this i am sorry for asking stupid question but lose of sleep andsick makes u a bit weird
ON my SUBMIT button i that this for the radio buttons

[AS] myLVs.radioGroup1 = radioGroup1.getValue();
myLVs.radioGroup2 = radioGroup2.getValue();[/AS]

so when it goes through the cgi form it says this

radioGroup1: Yes
which is good
and will write to the database radioGroup1

though on the recieve i have this

[AS]radioGroup1.setValue(myLVs.rG1);
radioGroup2.setValue(myLVs.rG2);[/AS]

so basically the retrieve button will be looking for an rG1 value but it wont exist cause the cgi form has writtin radioGroup1

would i have to change the

radioGroup1.setValue(myLVs.rG1);

to radioGroup1.setValue(myLVs.radioGroup1); ?

right?

Yes, you should change so that two names match… :wink:

just a small question is it normal
that after i press receive to sendthe store number under sendandload that
the number disappears
that is normal no?

Are you saying that the typed store number disappears after you press ‘send’ button??? Nope… It is not normal… :frowning:

this is my final i guess actionscript with ur great assistance.
some :crazy: stuff i gotta tell you!

I got one lil question, that I keep getting an error on,
This is the retrieve button by the way and the New lines i want to add are noted with the " // "

[AS]on (release)
{

NEW LINE // ------- > // if (store.text = “Wrong” )
myLVs = new LoadVars();
myLVs.sendAndLoad(“lrm.asp”, myLVs , “POST”);
myLVs.onLoad = function(success)
myLVs.storeID = store.text;
{
other.text = myLVs.other
details.text = myLVs.details
sponsor.text = myLVs.sponsor
raising.text = myLVs.raising
annual.text = myLVs.annual
traffic.text = myLVs.traffic;
store.text = myLVs.store
comments.text = myLVs.comments
varTextBox1.text = myLVs.varTextBox1
varTextBox2.text = myLVs.varTextBox2
varTextBox3.text = myLVs.varTextBox3
varTextBox4.text = myLVs.varTextBox4

	if (myLVs.restaurant1 == "Mccafe")
	{
		restaurant1.setValue(true);
	}
	if (myLVs.restaurant2 == "24 Hrs")
	{
		restaurant2.setValue(true);
	}
	if (myLVs.restaurant3 == "Drive Thru")
	{
		restaurant3.setValue(true);
	}
	if (myLVs.restaurant4 == "Playland")
	{
		restaurant4.setValue(true);
	}
	if (myLVs.restaurant5 == "Large Parking Facility")
	{
		restaurant5.setValue(true);
	}
	radioGroupp.setValue(myLVs.radioGroupp);
	radioGroup.setValue(myLVs.radioGroup);
	radioGroup1.setValue(myLVs.radioGroup1);
	radioGroup2.setValue(myLVs.radioGroup2);
	radioGroup3.setValue(myLVs.radioGroup3);
	radioGroup4.setValue(myLVs.radioGroup4);

	};

}
NEW LINE!!--------------->// } else {
trace(getURL(“javascript: alert(‘Please Enter a Store Number’), void(0)”));
}
};

[/AS]

what i am trying to do , i have in my asp scring a Store, value that if the value is wrong, it returns a Text in the store field saying WRONG and it doesn’t write any of the information
and goes to the else (trace)…

so let me explainthis a bit better.
IF the store=1234567890 any of those number its good to go, which i have in the ASP script
But if the script doesn’t recongnize any of the number it return
a text saying " WRONG" but i dont want it to return anything else, so i want the java pop up to appear that is why i did the trace id

undersatnd any of it? ikeep getting action scrip error and can’t figure it out :frowning: i am so sorry

maybe? this?
if (myLVS.storeerror == “Wrong”)
trace(getURL(“javascript: alert(‘Please Enter a Store Number’), void(0)”));

BUT BUT if it’s wrong i want nothing loading how can i do that?

i dunno HELP :stunned: :*(

Howdy…

trace(getURL("j a v a s c r i p t: alert('Please Enter a Store Number'), void(0)"));

is not a valid syntax…

getURL("j a v a s c r i p t: alert('Please Enter a Store Number'), void(0)");

This looks abit more closer, but it still is not a valid one…

getURL("j a v a s c r i p t:alert('Please Enter a Store Number'), void(0)"));

This might be…

Hey… I have another idea… Why not use drop down box for the store number and you provide all the valid store numbers and the customer just selects from the list???

PS> You need to get rid of all the spaces in ‘j a v a s c r i p t’ to get it working… Kirupa automatically changes it to ‘about’… :frowning:

Scene=Scene 1, Layer=retrieve, Frame=1: Line 55: ‘;’ expected
} else {
all day this stupid error i have been trying to figure it out all day!!

all that i want basically to say
If storeerror== “wrong”

dont Load any of the other values
and goright to show the java script
does that make sence?

after this i’ll stick to basic html :slight_smile:

Can you copy and paste whole script for the retrieve button again???

:hair: :hair: <me
on (release)


{

 		if (store.text == "Wrong")
		myLVs = new LoadVars();
        myLVs.storeID = store.text;
		myLVs.sendAndLoad("lrm.asp", myLVs , "POST");
        myLVs.onLoad = function(success)
        {
        // more if routines that will set up
		// the check boxes and radio buttons
		// comes right here...
		other.text = myLVs.other
		details.text = myLVs.details
		sponsor.text = myLVs.sponsor
		raising.text = myLVs.raising
		annual.text = myLVs.annual
		traffic.text = myLVs.traffic;   
		store.text = myLVs.store
		comments.text = myLVs.comments
		varTextBox1.text = myLVs.varTextBox1
		varTextBox2.text = myLVs.varTextBox2
		varTextBox3.text = myLVs.varTextBox3
		varTextBox4.text = myLVs.varTextBox4
	
		
		if (myLVs.restaurant1 == "Mccafe")
		{
			restaurant1.setValue(true);
		}
		if (myLVs.restaurant2 == "24 Hrs")
		{
			restaurant2.setValue(true);
		}
		if (myLVs.restaurant3 == "Drive Thru")
		{
			restaurant3.setValue(true);
		}
		if (myLVs.restaurant4 == "Playland")
		{
			restaurant4.setValue(true);
		}
		if (myLVs.restaurant5 == "Large Parking Facility")
		{
			restaurant5.setValue(true);
		}

		radioGroupp.setValue(myLVs.radioGroupp);
		radioGroup.setValue(myLVs.radioGroup);
		radioGroup1.setValue(myLVs.radioGroup1);
		radioGroup2.setValue(myLVs.radioGroup2);
		radioGroup3.setValue(myLVs.radioGroup3);
		radioGroup4.setValue(myLVs.radioGroup4);
	
	} else 
		getURL("javascript: alert('Please Enter a Store Number'), void(0)");
	}
	

if store is wrong, load error if not load the rest

Um…

Forget about the syntax… That code doesn’t give me any bell logically…

That is the retrieve button that loads previously saved data, right???
The first line of your code goes like this…

if (store.text == "Wrong")

How do you know if that is WRONG??? Does your user type it ‘WRONG’??? It can’t be because they were supposed to write numbers there…

If you meant this,

if (storeError == "Wrong")

How do you get that storeError variable??? I think that ‘storeError’ is the variable that you get the value after calling the ASP page, right??? Where is your ASP call??? The only ASP call I see in there is

myLVs.sendAndLoad("lrm.asp", myLVs , "POST");

which is executed AFTER the if condition…

You know what I am trying to say???
Your if statement cannot be true because you didn’t get the value back from the ASP code, and ASP code cannot get executed because your if condition doesn’t let you…

This code makes a little more sense to me… I hope this one works, but it’s up to you… :wink:

myLVs = new LoadVars();
myLVs.storeID = store.text;
myLVs.sendAndLoad("lrm.asp", myLVs , "POST");
myLVs.onLoad = function(success)
{
	if (myLVs.storeError == "Wrong")
	{
		getURL("j a v a s c r i p t: alert('Please Enter a Store Number'), void(0)");
	}
	else
	{
        // more if routines that will set up
        // the check boxes and radio buttons
        // comes right here...
        other.text = myLVs.other
        details.text = myLVs.details
        sponsor.text = myLVs.sponsor
        raising.text = myLVs.raising
        annual.text = myLVs.annual
        traffic.text = myLVs.traffic;
        store.text = myLVs.store
        comments.text = myLVs.comments
        varTextBox1.text = myLVs.varTextBox1
        varTextBox2.text = myLVs.varTextBox2
        varTextBox3.text = myLVs.varTextBox3
        varTextBox4.text = myLVs.varTextBox4
        
        if (myLVs.restaurant1 == "Mccafe")
        {
                restaurant1.setValue(true);
        }
        if (myLVs.restaurant2 == "24 Hrs")
        {
                restaurant2.setValue(true);
        }
        if (myLVs.restaurant3 == "Drive Thru")
        {
                restaurant3.setValue(true);
        }
        if (myLVs.restaurant4 == "Playland")
        {
                restaurant4.setValue(true);
        }
        if (myLVs.restaurant5 == "Large Parking Facility")
        {
                restaurant5.setValue(true);
        }
        
        radioGroupp.setValue(myLVs.radioGroupp);
        radioGroup.setValue(myLVs.radioGroup);
        radioGroup1.setValue(myLVs.radioGroup1);
        radioGroup2.setValue(myLVs.radioGroup2);
        radioGroup3.setValue(myLVs.radioGroup3);
        radioGroup4.setValue(myLVs.radioGroup4);
	}
}

exactly the ASP send the text variable in a Dynamic box i have, that is why i put Storeerror.text cause it’s a text box.

saying ERROR with the java thing popping up, the only problem i have i tihnk it still loads up some radio buttons form the script.

the last questio for the night lol
is,is ther a way to know
or to make submit a variable and retrieve a variable so the asp page knows if it’s submit or retrieving?

exactly the ASP send the text variable in a Dynamic box i have, that is why i put Storeerror.text cause it’s a text box.
Is that ‘Storeerror’ a new text field??? I don’t remember that one…
it still loads up some radio buttons form the script.
Yes… That’s the thing you have to sort in the ASP script… Don’t have those values saved to the database if the store number doesn’t exist in the ASP script…
is ther a way to know or to make submit a variable and retrieve a variable so the asp page knows if it’s submit or retrieving?
I don’t understand your question… Can you rephrase it??? :wink:

hey, well no the storeerror i forgot to add the.text after it,
where i have == “wrong” in the script.

so would i just add that little part in?

what i meant to say
is
so the server can recognize the difference between a submit and retrieve (sendAndLoad)

You are confusing me again… :frowning:

storeerror… Why do you need to specify the text property??? What is is??? Is it the text field instance name or the variable name that you get from your ASP code??? You are not supposed to add ‘.text’ at the end if it is the variable name…

so the server can recognize the difference between a submit and retrieve
That YOU have to specify when you use sendAndLoad() function…

Add this line

myLVs.action = "RETRIEVE";

right below this line…

myLVs.storeID = store.text;

and use action variable at the ASP code…

this is what i did,.
I made a Dynamic Box, … and named it storerror
as an instance Name

so basically when the the asp check, and if the store number is wrong it send a text value saying WRONG along with the javascript popping up?
is the more clearer? i think i dont even know anymore

Yes… But, if that is what you want to do, where is the code that assigns value to that ‘storerror’ text field??? You are missing that… :wink: