Re: PHP with Javascript tutorials?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Chris,

Sorry I can't give you a more full response right now (or the actual code..).

View source from this little form that I built:
<http://www.thewhitebear.com/tools/formtest.php>

It's just a proof of concept, but uses javascript arrays. A friend of mine said he turned the above simple script into modules for both Perl and PHP. I'll check with him to see if they are done and available.

I've been working on a more complicated set of dropdowns that is very similar to the sample you described. I decided against preloading all of the arrays, because each one has to be generated by a db call (it's a college alumni database, and it only pulls states/counties/provinces where alumni actually reside). So instead of all the db calls and the huge array of arrays, I added a javascript onSelect() call to the country drop down which actually submits the form, but changes the action of the form to the form itself and then adds a new dropdown for state/country/province (and preserves anything entered in the other form field elements).

Let me know if you think you need the second option or more Javascript details for the first option.

HTH,

-Ben Riddell

At 11:33 AM 6/25/2004, Chris Payne wrote:
Hi there everyone,



I've been looking on Google for PHP Javascript tutorials but I can't find
any.  I'm new to Javascript but can use PHP for what I need.  I was hoping
someone would know of a tutorial that would show how to use PHP to get 2-3
datasets which javascript can then use in forms.  For example, say I have 3
pulldown boxes, one would have countries - such as UK, USA etc .. If you
selected the UK it would bring up countries in the UK, and if you select a
country the third pulldown would show the cities in that country (This is
just an example to hopefully explain what I need) but I don't want the page
to refresh everytime I select an option which it does if you just use PHP.



Any help would be EXTREMELY greatly received :-)



Regards



Chris

---------------------------- ------- Ben Riddell -------- -- Freelance Web Developer - --- ben@xxxxxxxxxxxxxxxx --- --- www.thewhitebear.com --- ------- 510/332.2979 ------- ----------------------------

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux