in reply to how to make dependent drop down in perl script
so by selecting Country name from 1st drop down , the State name get populated .
Both value (Country name and State name) are populated from database .
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to make dependent drop down in perl script
by cavac (Prior) on Mar 13, 2023 at 13:07 UTC | |
Since you want to do this with HTML, this will require some Javascript as well. I rather suspect that somthing like
will be involved. What it boils down to: If you make a website, you'll need to learn HTML, Javescript and CSS in addition to your backend language (perl, php, python or nodejs). Edit: As a sidenote, especially for my friends in th USA: Not all countries have states or regions, especially the smaller ones. Monaco and Liechtenstein are small enough for a single postal worker to know all the adresses. And is Sealand ever gets recognized, you can tour the whole country in about 15 minutes flat.
PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
| [reply] [d/l] |
by Anonymous Monk on Mar 15, 2023 at 18:55 UTC | |
| [reply] |
by cavac (Prior) on Mar 16, 2023 at 08:52 UTC | |
Ajax just does a HTTP request to the URL you specify. On the server side, you handle it like any other web request. I don't have the energy to write a custom example, i'm still suffering from an inflamed right wrist. This example is just taken straight from my own framework (in this example, we are checking if the filename already exists on the server before an upload). First we need some JavaScript to define to do the Ajax call, see images.tt:
On the Perl side, we then handle the request and send a document to the client, see Images.pm:
The code in your project will probably look quite a bit different (different framework, different task), but the gist of it will be the same:
Hope that helps.
PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
| [reply] [d/l] [select] |