Jump to content

auto loading forms?


php_b34st

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?
Link to comment
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.
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.