[thelist] ajax and form population

Dean Mah dean.mah at gmail.com
Wed Dec 14 19:08:11 CST 2005


I've got a suggestion.  In your dynamic code, put the "alert('email: '
+ email);" line after the "if (xmlhttp.readyState ==4) { ... }" block
and see if that does anything.

Dean

On 12/14/05, Dan McCullough <dan.mccullough at gmail.com> wrote:
> Okay an update.
>
> When the variables in the php script are static then the script works
> without a hitch.  When the variables are populated from the database
> the script doesnt work.
> Here are some links for you to test and see what I am seeing.  Use
> dan.mccullough at gmail.com as the email address.
>
> The form:
> http://www.heathermccullough.com/ajax/index_static.html
> http://www.heathermccullough.com/ajax/index_dynamic.html
>
> Behind the scenes:
> http://www.heathermccullough.com/ajax/getEmail_static.php?email=dan.mccullough@gmail.com
> http://www.heathermccullough.com/ajax/getEmail_dynamic.php?email=dan.mccullough@gmail.com
>
> The source of behind the scenes:
> http://www.heathermccullough.com/ajax/getEmail_static_source.php
> http://www.heathermccullough.com/ajax/getEmail_dynamic_source.php
>
> If you view source on the php page you will just the the xml output,
> if you want to see the js then view source on the html file.
>
>
>
> On 12/14/05, Dan McCullough <dan.mccullough at gmail.com> wrote:
> > Ended up rewritting the script, just too much clutter and crap to
> > remember why I did something a certain way.
> >
> > http://www.heathermccullough.com/ajax/index.html, right now everything
> > returns the same information not tied to db just need to see if the
> > theory was working before I added bells and whistles.
> >
> > Weeeeeeeeeeeeee
> >
> > On 12/14/05, Dan McCullough <dan.mccullough at gmail.com> wrote:
> > > Oh well seems I jumped the gun, still not getting back responseText,
> > > now when I echo everything it seems to come out in the responseText
> > > alert.  Like the SQL statement and the Array the data comes back in,
> > > but when I take that stuff out and just try the responseText I either
> > > get a blank or undefined.
> > >
> > > On 12/13/05, Dan McCullough <dan.mccullough at gmail.com> wrote:
> > > > You know I thought I had gotten all the stupid problems out of there
> > > > before I went to the list :(.  Anyway I get data back but its one
> > > > field filling the three form fields.  So now I have to figure out how
> > > > to assign data to fields.
> > > >
> > > >
> > > > On 12/13/05, Matt Warden <mwarden at gmail.com> wrote:
> > > > > -----BEGIN PGP SIGNED MESSAGE-----
> > > > > Hash: SHA1
> > > > >
> > > > >
> > > > > Dan,
> > > > >
> > > > > If you open up the URL in your browser, you see that you don't get
> > > > > anything returned:
> > > > >
> > > > > http://treasureentrilogy.modulestreams.com/call_center/functions.php?do=getUser&email=dan.mccullough@gmail.com
> > > > >
> > > > > When you call this in your PHP:
> > > > >
> > > > > getUser($cnnDB,$email);
> > > > >
> > > > > $email is not defined, and would only have a value if your server has
> > > > > register_globals on. Try: getUser($cnnDB,$_GET['email']);
> > > > >
> > > > > and just for yucks, add this as your second line to getUser():
> > > > >
> > > > > echo $SQL;
> > > > >
> > > > > and this after $row is defined:
> > > > >
> > > > > echo '<pre>'. print_r($row, 1) . '</pre>';
> > > > >
> > > > > Then call the script again in your browser with the above link.
> > > > >
> > > > > Dan McCullough wrote:
> > > > > > http://treasureentrilogy.modulestreams.com/call_center/ is the URL and
> > > > > > dan.mccullough at gmail.com can be used for the email and just tab out of
> > > > > > the field you should get a few alerts, I hardcoded one line in there
> > > > > > to make sure I was getting some information from certain parts of the
> > > > > > script.  if the script is working the first name, last name and
> > > > > > address 1 should be populated.
> > > > > >
> > > > > > On 12/13/05, Matt Warden <mwarden at gmail.com> wrote:
> > > > > >
> > > > > >
> > > > > > Dan,
> > > > > >
> > > > > > Dan McCullough wrote:
> > > > > >
> > > > > >>Hopefully this is not boring anyone, but I havent been able to find a
> > > > > >>straight foward ajax/php form updating example I've only been able to
> > > > > >>find bits and pieces.  So any help or pointing out errors would be a
> > > > > >>great appreciation.
> > > > > >
> > > > > > I looked through your code, and nothing jumps out at me. But, really, it
> > > > > > would be a lot easier if we could see a URL and play with it a little.
> > > > > >
> > > > > > In the meantime, maybe these will help you:
> > > > > >
> > > > > > http://mwarden.f2o.org/sandbox/ajax.htm
> > > > > > http://mwarden.f2o.org/sandbox/viewsource.php?linemode=0&f=ajaxSearchForUsername.php
> > > > > >
> > > > > > I also have a more complicated example that deals more with XML
> > > > > > communication and DOM manipulations, but it might help you some:



More information about the thelist mailing list