• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: validate submit with a radio button

validate submit with a radio button 16 years 11 months ago #328

  • bouton
  • bouton's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I have a form for download which needs a license acceptance with a radio button
1. accept
2. don't accept
if accept - go to download
if don't accept - confirm - are you sure, then redirect.

How would I do this. setting radio to mandatory didn't seem to work

thanks - great job. sooo easy to set the basics up!
The administrator has disabled public write access.

Re:validate submit with a radio button 16 years 11 months ago #332

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
Hm, let's see

Start by naming your radio buttons field id: accept

Add to the Not Accept radio Additional Attributes : onclick=processRadio();

Then, add to the end of the Form Style code this piece of code:
<script language=\"javascript\">
function processRadio(){
accept = document.getElementById('accept');
return confirm('Are you sure?');
}
</script>

Let me know if it works. I tested and worked for me.
The administrator has disabled public write access.

Re:validate submit with a radio button 16 years 11 months ago #448

  • bouton
  • bouton's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
It works - does exactly what I asked -but I asked the wrong thing.
Basically I am trying to validate the form via radio buttons. I ONLY want the form submitted if the \"agree\" radio button is selected. If the \"don't agree\" button is selected, I want the form to redirect to somewhere where instructions on the fact that agreement is needed to continue.

Sorry I wasn't clear.
The administrator has disabled public write access.

Re:validate submit with a radio button 16 years 11 months ago #449

  • alex
  • alex's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 443
  • Thank you received: 3
change the function into this:
function processRadio(){
document.location='mynewlocation.html';
}
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!