Hi, I have this website where there will be chat rooms. I would like to have a form(php script) of rules of conduct before people gets access to the chat rooms. The options: Yes to continue to the chat rooms, No to send them back to the Home page.
Thanks in advance for you help.



Please describe your question clearly..
or this is what you are searching...

<form name="confirm" method="post">
Do You want to continue to enter  into chat room?<br>
<br />
<input type="radio" name="confirm" value="1"> Yes<br>
<input type="radio" name="confirm" value="2"> No<br>

<input type="submit" value="Submit" onclick="get_radio_value()">

<script type="text/javascript">
function get_radio_value()
var val=0;
for (var i=0; i < document.confirm.confirm.length; i++)
   if (document.confirm.confirm[i].checked)
      	var val=document.confirm.confirm[i].value;
    if(val == 2)
	else if(val == 1)
		alert("Please Confirm!!");
		return false;

Reply with your queries with clear information..

Thanks for your prompt response.
I have this site with a menu that gives the user the option to click the link to open the chat room, rather that going directly in the chat room I want to show the user a page with rules of conduct in the chat room, and give the user the option to press YES (agreeing to the rules of conduct in the chat rooms)allowing the user into the chat room or press NO (not agreeing to the rules therefore going back to the main page of the site to continue browsing)

The code that you put in your response, seems to be close to what I am looking for, but when I attempted to run the code it did not work. Would you please post the complete code? thank you

<!-- Rules of conduct text here -->

<div style="width: 300px; text-align: center;">
Do you agree to the rules?
<br />
<button onclick="location.replace('chatroom.php')">Yes</button>
<button onclick="location.replace('home.php')">No</button>
<br />

This might work for you.

I think this might the solution. Is this the entire script?

Pretty much, other than formatting the page and maybe adding a background and border.

Now please bear in mind that this snippet has *zero* security measures and all a person would have to do is enter the url of the chatroom to bypass this screen.

I will give it a try. Thanks for all your help.