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

ok the storeerror as u said works fine. thanks.

as for the ON submit and retrieve

on submit button i put
myLVs.action = “Submit”;

and on the retrieve though it’s using sendandLoad i put
myLVs.action = “RETRIEVE”;
i guess that shouldn’t get the database confused if i used the variable name action=retrieve

I think think should be working,
I’ll let u know

thanks so far for all the Help=) my hat goes off to u though it’s not tipping:hat:

:sigh: ok ok time for another question

on (release){     
	 
	 myLVs = new LoadVars();
       myLVs.storeID = store.text;
	   myLVs.action = "Retrieve";
       myLVs.sendAndLoad("lrm.asp", myLVs , "POST");
       myLVs.onLoad = function(success)
{
        if (myLVs.storeError == "Wrong")
        {
                getURL("javascript: alert('Store Number is Invalid'), void(0)");
        }
        else

should not this work? if u type in store : 1234 and hit retrieve should it not LOAD up what ever is in the database?

I guess it should… Why??? It doesn’t load up all the variables from the database???

well strangely enough,
i dont know how to word this…

on retrieve = sendandLaod right? so itpass info

so i type the store number 1234 as a test
and hit retrieve and then the number disappears!

i dont get it lol

Post your code on the retrieve button, would you???

on (release){     
	 
	 myLVs = new LoadVars();
       myLVs.storeID = store.text;
	   myLVs.action = "Retrieve";
       myLVs.sendAndLoad("lrm.asp", myLVs , "POST");
       myLVs.onLoad = function(success)
{
        if (myLVs.storeError == "Wrong")
        {
                getURL("javascript: alert('Store Number is Invalid'), 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);
        }
}
}

this is for the retrieve button.

I have added three trace() in the code…
Run this and show me what you have in the output window… Do the copy and paste… :wink:

on (release)
{
	myLVs = new LoadVars();
	myLVs.storeID = store.text;
	myLVs.action = "Retrieve";
	myLVs.sendAndLoad("lrm.asp", myLVs, "POST");
	myLVs.onLoad = function(success)
	{
		trace("myLVs.storeError = " + myLVs.storeError);
		if (myLVs.storeError == "Wrong")
		{
			getURL("about : alert('Store Number is Invalid'), void(0)");
		}
		else
		{
			// more if routines that will set up
			// the check boxes and radio buttons
			// comes right here...
			trace("myLVs.store = " + myLVs.store);
			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);
		}
		trace(unescape(myLVs));
	};
}

what do u mean by output window?
when i click submit?

Nope… When you press the ‘Retrieve’ button, you will see the output window popping up… Copy what’s in there and paste it right here…

hey.

I just tried it
there was no windows poping up :frowning:

it just loaded the values in the places

Huh??? You are supposed to see at least one line… Delete the script in the ‘Retrieve’ button and replace that with this…
Let me know…

on (release)
{
	myLVs = new LoadVars();
	myLVs.storeID = store.text;
	myLVs.action = "Retrieve";
	myLVs.sendAndLoad("lrm.asp", myLVs, "POST");
	myLVs.onLoad = function(success)
	{
		if (success)
		{
			trace("myLVs.storeError = " + myLVs.storeError);
			if (myLVs.storeError == "Wrong")
			{
				getURL("about : alert('Store Number is Invalid'), void(0)");
			}
			else
			{
				// more if routines that will set up
				// the check boxes and radio buttons
				// comes right here...
				trace("myLVs.store = " + myLVs.store);
				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);
			}
			trace(unescape(myLVs));
		}
		else
		{
			trace("Connection to the server has failed...");
		}
	};
}

ok this is what i get.

http://localhost/tests/about%20:%20alert(‘Store%20Number%20is%20Invalid’),%20void(0)

this is when the asp page has storeerror = wrong.

You just get one line??? I don’t get it…

well yeh cause right now what the database is doig just writting a variable wrong back to flash u know?

i wonder is there a way to limite store.text to just numbrs?

do i do store.text = “1234567890”?

in my access database i had to think
one is 12345
and one is 123456

when i hit retrieve it just loads the first tone 12345

but if i hit 123456

it stills loads the 123456

do u think that problem is onthe asp page?
or with the code?

Well… All I can guess is that there should be something going on with your ASP page, but I know nothing about ASP…

To restrict the store number to be inputted with number, check out ‘TextField.restrict’ from the Flash manual…

yeh that is what i thin it’s my asp side maybe

cause when i have all the pre defined values in the text file

it loads up smoothly

i just wanted to ask u one more thing.
is there a way, to
make if statements for the radio buttons?
like if noting choice is selected not to load up?

You can use this, ‘FRadioButton.getValue’…

Check out the manual… It says, If no button is selected, the method returns undefined., and I think you can use this condition in conjunction with the if statement… :wink:


userData = new LoadVars();
userData.name = name;
userData.species = species;
userData.speciesType = speciesType.getValue();
userData.residence =
residence.getValue();

response = new LoadVars();
response.onLoad = getResponse(); 

userData.sendAndLoad("register.php", response, "post");

}

this is just an example i found on the net…
u notice how he has a userData = new LoadVars(); and then a response = new LoadVars();
and then he calles out to
userData.sendAndLoad(“register.php”, response, “post”);

do u think my problem is that i have


 myLVs = new LoadVars();
        myLVs.storeID = store.text;
        myLVs.action = "Retrieve";
        myLVs.sendAndLoad("lrm.asp", myLVs, "POST");
        myLVs.onLoad = function(success)

maybe i need to put another new LoadVar?

? what u think?
myLRs = new LoadVar();
myLRs.onLoad = getResponce?

i dunno maybe this is gibberish since it’s so late lol
but maybe it would do somethinG?

There is no difference whether you have one or two LoadVars() object… All that code does is to seperate the incoming and outgoing variables… If you want, you could try that though… You don’t need my permission to do that… :beam: