/    Sign up×
Community /Pin to ProfileBookmark

help with form, dont know if php is best way?

hey guys,

i am struggling to work something out and wondered if anyone could put me on the right path,

i am currently designing a form for an enquiry page on my website,

and what i would like to happen is say for example i have a drop down box with cetain values in it, if they select a value then another drop down box shows up next to it with values that are particular to the orginal value.

now i am not 100% if i can do this with php or not or wether javascript is a better way to do it, hence why i am asking.

btw the second form that shows up needs to be able to have a variable that i can access in mail script.

thanks in advance

vade

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@firebladeJul 29.2008 — hi Vade.. any how you have to use the PHP code to retrieve the value of combo box from server if it is in a database or something.

The best way to display the second combo box is using Ajax. I is the most easy and recommended way to do this.

If you are not willing to use Ajax, then use the PHP code to send the selected value and generate the second combo box.

You can also retrieve all the record of the second combo box to a JavaScript array on first load of the page, Then can use the JavaScript function to populate the values to second combo that related to the first combo when the use select a value in first combo. But it is very complex way.
×

Success!

Help @Vade spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...