3 Replies - 1176 Views - Last Post: 26 January 2013 - 08:04 AM

#1 yiann_is  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 25-December 12

pass values from javascript to my html5 radio buttons

Posted 26 January 2013 - 04:25 AM

I m trying to pass values on html5 radio buttons, so the user be able to select only one each time. And the number of radio depends of the #of results.This is what i ve done till now.
function Searching()
		{	
			
			document.getElementById('demo').style.visibility= 'visible';
			var selectedMovie=document.getElementById("movies").value;
			var selectedArea=document.getElementById("areas").value;
			var selectedDate=document.getElementById('date').value;
			var selectedTime=document.getElementById("time").value;

			for(var i=1;i<=document.getElementById("dataTable").rows.length;i++)
			{			
				if((selectedMovie==document.getElementById("dataTable").rows[i].cells[0].innerHTML) &&(selectedArea==document.getElementById("dataTable").rows[i].cells[5].innerHTML) && (selectedDate==document.getElementById("dataTable").rows[i].cells[2].innerHTML) &&(selectedTime==document.getElementById("dataTable").rows[i].cells[1].innerHTML) )
				{	
					document.getElementById("demo").innerHTML+="<b>Movie: </b>"+selectedMovie+" <b>Time: </b>"+selectedTime+"<b> Date: </b>"+selectedDate+"<b> Cinema: </b>"+document.getElementById("dataTable").rows[i].cells[3].innerHTML+"<b> Hall: </b>"+document.getElementById("dataTable").rows[i].cells[4].innerHTML+"<b> Area: </b> "+selectedArea+"<br/>";
				
				}
			}
		}

and here is the area to display the results
<p  id="demo" style="visibility:hidden"></p>


I tried to have radio buttons inside <p> but the radio button didn't connected with the result of javascript. Is there a way to appear radio buttons next to each line of my results or i have to play with css?

Is This A Good Question/Topic? 0
  • +

Replies To: pass values from javascript to my html5 radio buttons

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3524
  • View blog
  • Posts: 10,169
  • Joined: 08-June 10

Re: pass values from javascript to my html5 radio buttons

Posted 26 January 2013 - 04:29 AM

View Postyiann_is, on 26 January 2013 - 12:25 PM, said:

I tried to have radio buttons inside <p> but the radio button didn't connected with the result of javascript. Is there a way to appear radio buttons next to each line of my results or i have to play with css?

What does that mean? I have absolutely no idea, what you try to accomplish.
Was This Post Helpful? 0
  • +
  • -

#3 yiann_is  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 25-December 12

Re: pass values from javascript to my html5 radio buttons

Posted 26 January 2013 - 04:42 AM

View PostDormilich, on 26 January 2013 - 04:29 AM, said:

View Postyiann_is, on 26 January 2013 - 12:25 PM, said:

I tried to have radio buttons inside <p> but the radio button didn't connected with the result of javascript. Is there a way to appear radio buttons next to each line of my results or i have to play with css?

What does that mean? I have absolutely no idea, what you try to accomplish.


Sorry if i don't explain it well,ignore it. What i want to do is to pass values from javascript function to radio buttons.So the user be able to click only one and then fill other data.
Was This Post Helpful? 0
  • +
  • -

#4 yiann_is  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 25-December 12

Re: pass values from javascript to my html5 radio buttons

Posted 26 January 2013 - 08:04 AM

i figure something and it seems to work, until now
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1