Jump to content

Archived

This topic is now archived and is closed to further replies.

php_b34st

auto loading forms?

Recommended Posts

Im not sure if this can be done with php I think its done with javascript but there is no harm in asking right? I have seen sites with forms as soon as u do a certain thing on the form it loads more options without submitting ie if i change a radio button it would load a new set of options on the page. Anyone know if this can be done with php?

Share this post


Link to post
Share on other sites
Not with php, at least the client side portion is not php.  I would have to be javascript.

You can either load all of the values into javascript variables then manipulate the display based on selections, or you can use AJAX and some server side processing to generate html to replace portions of the page with.

Share this post


Link to post
Share on other sites
that can't be done with php, that is always done with javascript.  php only activates when you load a page(calls the server).  what you want is to use the onClick() event with your radio button and attach that to some javascript code that alters the dom. innerHTML is one easy dom element to use that has wide browser compatability.  To lookup the actual syntax to use you'll need the wc3 javascript reference manual:

http://www.w3schools.com/js/default.asp

Share this post


Link to post
Share on other sites
Yes I thought as much but I think that is beyond my capabilites for now. Thank you for verifying this for me.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.