Author Topic: Radio button control with URL  (Read 422 times)

Adem

  • Senior Member
  • ****
  • Posts: 171
  • Karma: 0
    • View Profile
Hello,

No problem confirm select option with URL

I just need help for the radio button

<a href="javascript:;" onclick="myFunction('2017-01-16-21-48');">Start</a>
Note: None of the default radio button is not selected
When the URL Start is clicked,
First warning => alert("Please select one of the radio buttons");
The user selected a radio button
Second warning => confirm("Do you want to continue? 2017-01-17-20-36");

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
  
  
<script>
  function 
myFunction(variable) {
      
confirm("Do you want to continue? " variable);
  }
  
</script>
  

  <form method="POST" action="file.php">
       Enable test mode: <input onChange='this.form.submit();' type="radio" value="yes" name="test"  />
      <br />
      Disable test mode: <input onChange='this.form.submit();' type="radio" value="no" name="test"  />
 </form>
 
 <form method="POST" action="file.php">
 <select size="1" name="folder" onChange="this.form.submit();">
 <option name"-1">&nbsp;</option>
 <option value="2017-01-17-20-36-TAM" >2017-01-18-21-42</option>     
 </select>
 </form>
 
 <a href="javascript:;" onclick="myFunction('2017-01-17-20-36');">Start</a>
 <br />
 <a href="javascript:;" onclick="myFunction('2017-01-16-21-48');">Start</a>
 



Thanks
« Last Edit: January 25, 2017, 01:41:56 am by Adem »

PHP Help Forum

Radio button control with URL
« on: January 25, 2017, 01:35:52 am »



PHP Help Forum

Re: Radio button control with URL
« Reply #1 on: January 25, 2017, 09:09:37 am »


Adem

  • Senior Member
  • ****
  • Posts: 171
  • Karma: 0
    • View Profile
What is the issue?

  <form method="POST" action="file.php">
       Enable test mode: <input onChange='this.form.submit();' type="radio" value="yes" name="test"  />
      <br />
      Disable test mode: <input onChange='this.form.submit();' type="radio" value="no" name="test"  />
 </form>

<a href="javascript:;" onclick="myFunction('2017-01-17-20-36');">Start</a>

Radio button control with URL


PHP Help Forum

Re: Radio button control with URL
« Reply #2 on: January 25, 2017, 02:06:11 pm »



PHP Help Forum

Re: Radio button control with URL
« Reply #3 on: January 25, 2017, 03:57:24 pm »


Adem

  • Senior Member
  • ****
  • Posts: 171
  • Karma: 0
    • View Profile
Repeating what you have already posted doesn't clarify anything. What are you actually trying to do? And what does it do instead?
I'm sorry I do not know english
I can not write long sentences

PHP Help Forum

Re: Radio button control with URL
« Reply #4 on: January 26, 2017, 07:36:04 am »



PHP Help Forum

Re: Radio button control with URL
« Reply #5 on: January 26, 2017, 09:50:00 am »



PHP Help Forum

Re: Radio button control with URL
« Reply #6 on: January 26, 2017, 03:16:53 pm »


astonecipher

  • Software Engineer
  • Professional PHP Helper
  • Senior Member
  • *
  • Posts: 2378
  • Karma: 95
    • View Profile
Then you need to remove all of these inline JavaScript calls,

1
 onChange='this.form.submit();'


Create a function that listens for the form being submitted and check if a radio button is checked.
Questions? Go here first.
http://www.phptherightway.com/

PHP Help Forum

Re: Radio button control with URL
« Reply #7 on: January 26, 2017, 03:39:47 pm »


Adem

  • Senior Member
  • ****
  • Posts: 171
  • Karma: 0
    • View Profile
Then you need to remove all of these inline JavaScript calls,

1
 onChange='this.form.submit();'


Create a function that listens for the form being submitted and check if a radio button is checked.
Thank you for the answer
I'm beginner
I could not understand, Can you write an example?

Thanks

PHP Help Forum

Re: Radio button control with URL
« Reply #8 on: January 28, 2017, 08:55:08 am »