Ursäkta, blev fel. Här kommer Poll.asp...vore mtk tacksam för hjälp.
<%
Sub ThePoll(SelectPoll)
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DSN=DSNpoll"
SQLPollID = "Select ID, Namn, Question From Poll Where Namn = '"& SelectPoll &"' "
Set RSPollID = Conn.Execute(SQLPollID)
SQLQuestions = "Select Question, ID From Questions Where PollID = "& RSPollID("ID") &" Order By ID Asc"
Set RSQuestions = Conn.Execute(SQLQuestions)
%>
<table Border="0" CellSpacing="1" CellPadding="0" BgColor="Black">
<tr>
<td>
<table Border="0" CellSpacing="0" CellPadding="2">
<tr>
<td ColSpan="2" Align="Center" Background="Bilder/Overline.gif">
<font face="Tahoma" Size="-1" Color="Yellow"><b>
<%= RSPollID("Question")%>
</b></font>
</td>
</tr>
\<%
cLoop = 0
Do While Not RSQuestions.EOF
cLoop = cLoop + 1
%\>
\<tr BgColor="White"\>
\<td\>
\<a href="javascript:SelectOne(\<%= RSQuestions("ID")%\>)" OnFocus="blur();"\>\<img Border="0" Src="Bilder/Button.jpg" Name="Bild\_\<%= RSQuestions("ID")%\>" WIDTH="20" HEIGHT="20"\>\</a\>
\</td\>
\<td\>
\<font face="Tahoma" Size="-2" Color="Black"\>
\<%= RSQuestions("Question")%\>
\</font\>
\</td\>
\</tr\>
\<%
RSQuestions.MoveNext
Loop
%\>
\<% If InStr(Request.ServerVariables("HTTP_USER_AGENT"), "MSIE") Then %\>
\<tr BgColor="White"\>
\<td Valign="Bottom" Align="Left"\>
\<a href="#" OnClick="javascript:window.open('../Poll/Resultat.asp?PollID=\<%= RSPollID("ID")%\>','Resultat','scrolling=no,resizable=yes,width=300,height=300')"\>\<img Src="Bilder/Resultat.Jpg" Border="0" WIDTH="50" HEIGHT="14"\>\</a\>\</td\>
\<td Align="Right" Valign="Bottom"\>
\<a href="javascript:SubmitWindow()"\>\<img Src="Bilder/Vote.Jpg" Border="0" WIDTH="45" HEIGHT="14"\>\</a\>\</td\>
\</tr\>
\<% Else %\>
\<tr BgColor="White"\>
\<td Valign="Bottom" Align="Left"\>
\<a href="#" OnClick="javascript:window.open('../Poll/Resultat.asp?PollID=\<%= RSPollID("ID")%\>','Resultat','scrolling=no,resizable=yes,width=300,height=300')"\>\<img Src="Bilder/Resultat.Jpg" Border="0" WIDTH="50" HEIGHT="14"\>\</a\>\</td\>
\<td Align="Right" Valign="Bottom"\>
\<a href="#" OnClick="SubmitWindow()"\>\<img Src="Bilder/Vote.Jpg" Border="0" WIDTH="45" HEIGHT="14"\>\</a\>\</td\>
\</tr\>
\<% End If %\>
</table>
</td>
</tr>
</table>
<script Language="Javascript">
var SelectedOne;
var Submitted = false;
function SelectOne(Which)
{
if(SelectedOne != null)
{
ThePic = "Bild_" + SelectedOne
document.images[ThePic].src = '../Poll/Bilder/Button.jpg';
}
SelectedOne = Which;
ThePic = "Bild\_" + Which;
document.images\[ThePic\].src = '../Poll/Bilder/Button_1.jpg';
}
function SubmitWindow()
{
if(Submitted != true && SelectedOne != null)
{
TheLink = "../Poll/Poll_Vote.asp?QuestionID=" + SelectedOne;
window.open(TheLink, 'Poll', 'scrollbars=no,resizable=no,width=200,height=100');
Submitted = true;
}
else
{
if(Submitted == true)
alert("Du kan bara rösta en gång!");
else
alert("Du måste göra ett val innan du kan rösta!");
}
}
</script>
<%
Set RSPollID = Nothing
Set RSQuestions = Nothing
Conn.Close
Set Conn = Nothing
End Sub
%>