...

View Full Version : Need this Survey with Feedback to work in HTML only



iT3d.
06-01-2012, 08:22 PM
Recently, the IT guy at work quit. Since the company can't afford to hire anyone else right now and I'm the one that knows the most about computers after him, I've been delegated to redo the website so we can quit using his code.

The problem with that is I barely know basic HTML. :confused:

So I have this ASP.net "Scam Exam" that is meant to drum up business for us, and when it was embedded in the IT guy's page it worked fine. Had a few grammatical errors, but the overall functionality made it sufficient.

Well now, i need this to work in the template that I downloaded to use for the site and ran into an issue - the tempalte is only HTML, and I don't know enough about ASP.net to rework it.

So I need help taking the following code and making it work as radio buttons that will be answered and load feedback (without shifting the page) when the submit button is pressed.

Please help!


<script runat="server">
Sub submit(Sender As Object, e As EventArgs)
If coldyes.Checked Then
Label1.Text = "A company may not sell private placement securities or commodities through general solicitation." & "<br />" & "<br />"
ElseIf coldno.Checked Then
Label1.Text = ""
End If

If predyes.Checked Then
Label2.Text = "By telling you something may be a 'sure thing' or that it 'can't miss' a company may have used predatory sales tactics, which is not legally accepted." & "<br />" & "<br />"
ElseIf predno.Checked Then
Label2.Text = ""
End If

If misrepyes.Checked Then
Label3.Text = "By promising, or even suggesting large returns, the company may have misrepresented material facts, which is against regulations for securities and commodities." & "<br />" & "<br />"
ElseIf misrepno.Checked Then
Label3.Text = ""
End If

If jvyes.Checked Then
Label4.Text = "As setup, most joint venture investments do not operate as true joint ventures and instead are simply labeled as such to skirt securities issues. We have yet to see a legitimate joint venture in private placement securities." & "<br />" & "<br />"
ElseIf jvno.Checked Then
Label4.Text = ""
End If

If contactyes.Checked Then
Label5.Text = "We have many clients who were unable to obtain any information from the companies in which they invested after they had turned over their money." & "<br />" & "<br />"
ElseIf contactno.Checked Then
Label5.Text = ""
Label6.Text = ""
End If

If contactyes.Checked And excuseyes.Checked Then
Label6.Text = "Were the company operating legitimately, there would be no trouble assisting you with answering your questions or other issues." & "<br />" & "<br />"
ElseIf excuseno.Checked Then
Label6.Text = ""
ElseIf excusena.Checked Then
Label6.Text = ""
End If

If coldyes.Checked Or predyes.Checked Or misrepyes.Checked Or jvyes.Checked Or contactyes.Checked Then
Label7.Text = "Therefore, it would appear you may have fallen victim to a scam and should seek assistance. Should you find yourself in our services, please proceed to the <a href='Contact.aspx'>Contact Page</a> and contact us by phone, email, or the provided form for more information.."
Else
Label7.Text = "Even though you answered 'No' to everything, there could still exist a possibility you've fallen victim to an investment scam. Please proceed to the <a href='Contact.aspx'>Contact Page</a> and contact us by phone, email, or the provided form for more information."
End If
End Sub
</script>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<h2>
Colt Ledger & Associates' Scam Exam
</h2>
<table width="100%" border="0" cellpadding="5" cellspacing="5" align="left">
<tr valign="top"><td width="50%">
Have you invested with a company that initially contacted you via a "cold call?" <br />
<asp:RadioButton ID="coldyes" Text="Yes" GroupName="coldcall" runat="server" /> &nbsp;
<asp:RadioButton ID="coldno" Text="No" GroupName="coldcall" runat="server" />
</td>
<td width="50%" rowspan="7">
<asp:Label style="color:Red" id="Label1" runat="server"/>
<asp:Label style="color:Red" id="Label2" runat="server"/>
<asp:Label style="color:Red" id="Label3" runat="server"/>
<asp:Label style="color:Red" id="Label4" runat="server"/>
<asp:Label style="color:Red" id="Label5" runat="server"/>
<asp:Label style="color:Red" id="Label6" runat="server"/>
<asp:Label style="color:Red" id="Label7" runat="server"/>
</td></tr>
<tr valign="top"><td>
When you were asked to invest, were you told this was a "sure thing" or that they "can't miss?" <br />
<asp:RadioButton ID="predyes" Text="Yes" GroupName="predatory" runat="server" /> &nbsp;
<asp:RadioButton ID="predno" Text="No" GroupName="predatory" runat="server" />
</td>
</tr>
<tr valign="top"><td>
Were you promised, even by suggestion, that there would be large returns over a short period of time? <br />
<asp:RadioButton ID="misrepyes" Text="Yes" GroupName="misrepresentation" runat="server" /> &nbsp;
<asp:RadioButton ID="misrepno" Text="No" GroupName="misrepresentation" runat="server" />
</td>
</tr>
<tr valign="top"><td>
Was your investment part of a Joint Venture? <br />
<asp:RadioButton ID="jvyes" Text="Yes" GroupName="jointventure" runat="server" /> &nbsp;
<asp:RadioButton ID="jvno" Text="No" GroupName="jointventure" runat="server" />
</td>
</tr>
<tr valign="top"><td>
After making your investment, was it hard to reach/contact the company in which you made the investment? <br />
<asp:RadioButton ID="contactyes" Text="Yes" GroupName="contact" runat="server" /> &nbsp;
<asp:RadioButton ID="contactno" Text="No" GroupName="contact" runat="server" />
</td>
</tr>
<tr valign="top"><td>
If you were able to reach the company, did you receive excuse, after excuse, after excuse as to why your investment wasn't bringing any results?<br />
<asp:RadioButton ID="excuseyes" Text="Yes" GroupName="excuse" runat="server" /> &nbsp;
<asp:RadioButton ID="excuseno" Text="No" GroupName="excuse" runat="server" /> &nbsp; <asp:RadioButton ID="excusena" Text="N/A" GroupName="excuse" runat="server" />
</td>
</tr>
<tr valign="top"><td>
<asp:Button ID="bScam" Text="Submit" OnClick="submit" runat="server" />
</td>
</tr>
</table>
</asp:Content>

EpicWebDesign
06-02-2012, 08:37 PM
Here you go. I would suggest using CSS to style it up a bit, but it's at least functional for you now.

Here is the javascript code that should be placed before the </head> tag in your template: (Note: I changed the Contact Page link to "Contact.htm" since you said you were only using HTML. That link is referenced twice in the script so you'll want to double check that the file name is correct.)



<script type="text/javascript">

function getFeedback() {
var L1 = document.getElementById('Label1');
var L2 = document.getElementById('Label2');
var L3 = document.getElementById('Label3');
var L4 = document.getElementById('Label4');
var L5 = document.getElementById('Label5');
var L6 = document.getElementById('Label6');
var L7 = document.getElementById('Label7');

if(document.getElementById('coldyes').checked ) {
L1.innerHTML="A company may not sell private placement securities or commodities through general solicitation.<br /><br />";
}
else if(document.getElementById('coldno').checked) {
L1.innerHTML="";
}

if(document.getElementById('predyes').checked) {
L2.innerHTML="By telling you something may be a 'sure thing' or that it 'can't miss' a company may have used predatory sales tactics, which is not legally accepted.<br /><br />";
}
else if(document.getElementById('predno').checked) {
L2.innerHTML="";
}

if(document.getElementById('misrepyes').checked) {
L3.innerHTML="By promising, or even suggesting large returns, the company may have misrepresented material facts, which is against regulations for securities and commodities.<br /><br />";
}
else if(document.getElementById('misrepno').checked) {
L3.innerHTML="";
}

if(document.getElementById('jvyes').checked) {
L4.innerHTML="As setup, most joint venture investments do not operate as true joint ventures and instead are simply labeled as such to skirt securities issues. We have yet to see a legitimate joint

venture in private placement securities.<br /><br />";
}
else if(document.getElementById('jvno').checked) {
L4.innerHTML="";
}

if(document.getElementById('contactyes').checked) {
L5.innerHTML="We have many clients who were unable to obtain any information from the companies in which they invested after they had turned over their money.<br /><br />";
}
else if(document.getElementById('contactno').checked) {
L5.innerHTML="";
}

if(document.getElementById('contactyes').checked && document.getElementById('excuseyes').checked) {
L6.innerHTML="Were the company operating legitimately, there would be no trouble assisting you with answering your questions or other issues.<br /><br />";
}

else if(document.getElementById('excuseno').checked || document.getElementById('excusena').checked) {
L6.innerHTML="";
}

if(document.getElementById('coldyes').checked || document.getElementById('predyes').checked || document.getElementById('misrepyes').checked || document.getElementById('jvyes').checked ||

document.getElementById('contactyes').checked) {
L7.innerHTML="Therefore, it would appear you may have fallen victim to a scam and should seek assistance. Should you find yourself in need of our services, please proceed to the <a

href='Contact.htm'>Contact Page</a> to contact us by phone, email, or use the provided form for more information.";
}
else {
L7.innerHTML="Even though you answered 'No' to everything, there could still exist a possibility you've fallen victim to an investment scam. Please proceed to the <a href='Contact.htm'>Contact

Page</a> to contact us by phone, email, or the provided form for more information.";
}
}
</script>


And here is the HTML code to place within the body of the page:


<h2> Colt Ledger & Associates' Scam Exam</h2>
<table width="100%" border="0" cellpadding="5" cellspacing="5" align="left">
<tr valign="top"><td width="50%">
Have you invested with a company that initially contacted you via a "cold call?" <br />
<input type=radio name="Cold" id="coldyes" Text="Yes" /> Yes &nbsp;
<input type=radio name="Cold" id="coldno" Text="No" /> No <br />
</td>
<td width="50%" rowspan="7">
<div style="color:Red" id="Label1" /></div>
<div style="color:Red" id="Label2" /></div>
<div style="color:Red" id="Label3" /></div>
<div style="color:Red" id="Label4" /></div>
<div style="color:Red" id="Label5" /></div>
<div style="color:Red" id="Label6" /></div>
<div style="color:Red" id="Label7" /></div>
</td></tr>
<tr valign="top"><td>
When you were asked to invest, were you told this was a "sure thing" or that they "can't miss?" <br />
<input type=radio name="Pred" id="predyes" Text="Yes" /> Yes &nbsp;
<input type=radio name="Pred" id="predno" Text="No" /> No
</td>
</tr>
<tr valign="top"><td>
Were you promised, even by suggestion, that there would be large returns over a short period of time? <br />
<input type=radio name="Misrep" id="misrepyes" Text="Yes" /> Yes &nbsp;
<input type=radio name="Misrep" id="misrepno" Text="No" /> No
</td>
</tr>
<tr valign="top"><td>
Was your investment part of a Joint Venture? <br />
<input type=radio name="JV" id="jvyes" Text="Yes" /> Yes &nbsp;
<input type=radio name="JV" id="jvno" Text="No" /> No
</td>
</tr>
<tr valign="top"><td>
After making your investment, was it hard to reach/contact the company in which you made the investment? <br />
<input type=radio name="Contact" id="contactyes" Text="Yes" /> Yes &nbsp;
<input type=radio name="Contact" id="contactno" Text="No" /> No
</td>
</tr>
<tr valign="top"><td>
If you were able to reach the company, did you receive excuse, after excuse, after excuse as to why your investment wasn't bringing any results?<br />
<input type=radio name="Excuse" id="excuseyes" Text="Yes" /> Yes &nbsp;
<input type=radio name="Excuse" id="excuseno" Text="No" /> No &nbsp;
<input type=radio name="Excuse" id="excusena" Text="N/A" /> N/A
</td>
</tr>
<tr valign="top"><td>
<input type=button id="bScam" Value="Submit" OnClick="getFeedback()" />
</td>
</tr>
</table>


Let me know if you need anything else.

iT3d.
06-04-2012, 03:10 PM
My dear God! You are amazing!

EpicWebDesign
06-04-2012, 06:06 PM
My dear God! You are amazing!

Well thank you! :thumbsup:

alykins
06-05-2012, 05:24 PM
the only problem is now the script in in javascript and anyone who knows how to view source can see it- what you need to do is take Epic's suggestion along with the original code and make it on a button click and have the page do a postback to display the results.

EpicWebDesign
06-05-2012, 06:49 PM
the only problem is now the script in in javascript and anyone who knows how to view source can see it- what you need to do is take Epic's suggestion along with the original code and make it on a button click and have the page do a postback to display the results.

I agree. It should be called externally, but wanted to make sure it worked with his template first and did what they wanted.

EpicWebDesign
06-07-2012, 01:10 AM
@IT3d: per our PM's, the updated code & instructions for editing to callthe the JS externally have been sent to you at your work email. If you don't see it, check your junk/spam folder as it was sent from my office email which differs from the one I use in forums. Please excuse any typos. Once again I am posting from my phone :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum