On Jul 11, 10:46 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
wrote:
> Its doing the second ajax updater (the one with the alert in it) regardless
> of the flag. It is showing the text up because you are in effect putting a
> break point in it with the alert();
>
> I would look at where the "flaglast" variable is set and make sure it is
> false in the  first instance. You might also want to typecast it to make

Alex,

I have tried various options but the returned text still flashes by!

I have checked that at the start of the function with the code I have
shonw in it, flag10 is false and flaglast is true and indeed the right
code is used as the right values get into mysql (i.e. those using the
second set of Ajax code).

So I still don't see why the text from the php flashes before my eyes!

I must be still missing some thing!

Cheers

Geoff

> sure its boolean:
> var flaglast=false;
>
> Ajax code {.............}
> // Notice the 3 equals)
> if(flaglast===true) {
> do something
>
> }
>
> or you could remove the else if and use a switch or just "ifs"
>
> if(flag10===true) {
> .. do stuff}
>
> if(flaglast===true) {
> do some other stuff....
>
> } else {
>
> alert("Oops something went wrong");
>
> }
>
> HTH
>
> Alex
>
> ----- Original Message -----
> From: "geoffcox75" <g...@freeuk.com>
> To: "Prototype & script.aculo.us" <prototype-scriptaculous@googlegroups.com>
> Sent: Saturday, July 11, 2009 10:15 AM
> Subject: [Proto-Scripty] Re: text from php flashes by!?
>
> Alex,
>
> It's just that wheb flaglast is true the code
>
>     new Ajax.Updater(
>         'updateDiv',
>         'fv-c1-arrays4-mysql-minus-wm.php',
>         {
>             asynchronous:true,
>             method:'post',
>             parameters: params
>         }
>     );
>
> works fine and updates the mysql database using the php file but the
> text message coming back from the php file into the updateDiv <div>
> only stays on the screen for a split second unless I add the alert! Of
> course I do not want the alert but by chance I found that having the
> alert for some reason causes the message to stay on the screen ...
>
> Cheers
>
> Geoff
>
> On Jul 11, 9:57 am, "Alex McAuley" <webmas...@thecarmarketplace.com>
> wrote:
> > Can you explain it a bit better as i cant understand what you are asking !
>
> > Alex
>
> > ----- Original Message -----
> > From: "geoffcox" <g...@freeuk.com>
> > To: "Prototype & script.aculo.us"
> > <prototype-scriptaculous@googlegroups.com>
> > Sent: Saturday, July 11, 2009 9:53 AM
> > Subject: [Proto-Scripty] text from php flashes by!?
>
> > > Hello,
>
> > > Can anyone see why unless I have
>
> > > alert("press OK"); or some other alert message,
>
> > > when flaglast is true, the text coming from the php script only stays
> > > on the screen for a split second!
>
> > > Thanks
>
> > > Geoff
>
> > > if (flag10 == true) {
> > > new Ajax.Updater(
> > > 'updateDiv',
> > > 'fv-c1-arrays4-mysql-minus-wm.php',
> > > {
> > > asynchronous:true,
> > > method:'post',
> > > parameters: params
> > > }
> > > );
> > > resultsSaved = true;
> > > flag10 = false;
>
> > > } else if (flaglast == true) {
> > > alert("press OK");
> > > new Ajax.Updater(
> > > 'updateDiv',
> > > 'fv-c1-arrays4-mysql-minus-wm.php',
> > > {
> > > asynchronous:true,
> > > method:'post',
> > > parameters: params
> > > }
> > > );
> > > resultsSaved = true;
> > > flaglast = false;
> > > } else {
> > > alert("oops");
> > > }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to