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
https://forums.phpfreaks.com/topic/164925-onchange-submitting-form/
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.

Archived

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

×
×
  • 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.