Jump to content

onchange submitting form


infiniphunk

Recommended Posts

Hello, please forgive me if I've posted this in the wrong forum. Here is what I'm trying to do.

I want to make a form who's content changes dynamically as the user selects options, such as from a drop-down menu or radio buttons. I've googled around and just can't find a good howto on how this is done. You guys know what I'm talking about, we've all seen pages on the web that do this. For instance, you select an option and the form immediately updates itself to show further form input options pertaining to that selection (that don't need to be shown if that option is not selected). From what I understand there is a java function that does this, and I'd be ok with doing it that way if I have to. What is this called?

Otherwise I'd prefer to stay clear of java if I can do this using php alone. Is there no way to integrate a submit button into a radio button or a select option entry? Any ideas much appreciated!

Link to comment
Share on other sites

It's javascript not java. They are entirely different languages.

 

You can do it with php, but it will require a page reload, and you will need to add a button if order to reload the page with the new form element. To do this, you just add a button that says something like 'add new form element', then check in php to see if that was the button that was submitted. If it was, then you add the new form element, and send it back to the user.

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.