Jump to content

Recommended Posts

Hello,

 

I'm wondering if there's a way to submit the form information without needing to click the submit button.  For example, I would like the page to re-load with the values as soon as someone's clicked a radio button, or selected the option from the drop down list.

 

I would like to have that feature available in order to determine which options to display based on the user input.

 

If you need some more information, or if anything's not clear, please let me know - and I'll try to elaborate.

Thanks very much in advance!

 

 

~C.

Link to comment
https://forums.phpfreaks.com/topic/151665-solved-page-re-fresh-after-input/
Share on other sites

Thanks for the reply, but I'm not sure this is what I'm looking for. Instead of having a bunch of radio buttons or a dropdown list and a submit button. I just want some radio buttons and once the button is selected the page refreshes with some new form elements based on the previous selection.  After looking around, it seems it's only doable with javascript with the "OnClick" value. And I can't stand javascript. :(

If you don't want a re-load then yes your need some client side code (i.e. JS)

 

if you don't mind a page reload then you can use onclick to submit the form (or trigger a ajax routine)

onclick="javascript:form.submit()"

 

Thanks!  Obviously that's a js function, what would the function code be?  I'm sorry, I can't figure out JS to save my life..

submit() is the method of a form object.

 

 

For example, if you had:

 

<form name="some_form" id="some_form_id">

 

You could do:

 

document.forms.some_form.submit();

 

or

 

document.getElementById('some_form_id').submit();

 

to submit the form.

 

Thank you very much for clearing this up.  I've now got exactly what it is I wanted to get done.

 

Again, you've all been a great help!

 

~C.

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.