Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Adding a scriptAdding a script
Previous
 
Next
New Post
3/1/2011 6:21 AM
 
Hello,

I am trying to add the script below to a clients site. If I add one instance of it, it doesn't work. If I add the code twice, the one below works but the first one doesn't. I am adding the code via HTML module header field in advanced settings. I have also added via HTML source.

Any help would be appreciated.

Regards,

Richard


The script is

<form method="post" name="inputForm" action="http://www.graphicmail.co.za/RWCode/subscribe.asp?SiteID=xxx&SID=14">
<input type="hidden" name="SID" value="14">
<input type="hidden" name="ReturnURL" value="http://www.xxxxxxxx.com/Home/Registration2.aspx">
<input type="hidden" name="Resize" value="1">
<input type="hidden" name="Mode" value="">
<input type="hidden" name="ResultMode" value="">
<input type="hidden" name="HitID" value="0">
<input type="hidden" name="OldEmail" value="">
<input type="hidden" name="EmailChange" value="0">
<input type="hidden" name="EmailID" value="0">
<table cellspacing="0" cellpadding="0" border="0" align="center">
<tr><td><div><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'><style>.defaultButtons{}</style></div>
<table cellpadding=0 cellspacing=0 border=0>
<tr><td colspan="2" align="left"><table border=0 cellpadding=0 cellspacing=2>
<tr>
<td width="10%" align="right" nowrap><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'><b>Email&nbsp;&nbsp;&nbsp;</td>
<td><input face="text" name="Email" size="40" value=""></td>
</tr>
<tr><td align=right nowrap><b><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'>First name &nbsp;&nbsp;&nbsp;</td><td><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'><input type="text" name="Col1" size="40" value=""></td></tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="2" align="center" nowrap>
<a href=" if(testInput()){document.inputForm.Mode.value='update'; document.inputForm.submit();}"><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'><b>Subscribe</b></a>&nbsp;&nbsp;
<a href=" if(testInput()){document.inputForm.Mode.value='unsubscribe'; document.inputForm.submit();}"><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'><b>Unsubscribe</b></a>
</td>
</tr>
</table></td></tr></table><div><font style='font-family:Verdana; font-size:12px; color:#000000        ; font-weight:Normal'><center>Thank you for requesting our Meal Plans, Recipes and Newsletter.<br /><br />&nbsp;</center></div></td></tr>
</table>
</form>
<script language='javascript'>
function testInput() {
var sAlert = '';
var Email =  new String(document.inputForm.Email.value);
var Correct = true;
CharCount=1;
strLength=Email.length;
while ((CharCount < strLength) && (Email.charAt(CharCount) != '@'))
{
CharCount++
}
if ((CharCount>= strLength) || (Email.charAt(CharCount) != '@'))  
{  
sAlert += '* \n';
Correct = false;
}
else
{
CharCount += 2;
}
while ((CharCount < strLength) && (Email.charAt(CharCount) != '.'))
{
CharCount++
}
if ((CharCount>= strLength - 1) || (Email.charAt(CharCount) != '.'))
{
if(Correct==true)
{
sAlert += '* \n';
}
Correct = false;
}
if(Correct==true && document.inputForm.Email!=null){
var inputEmail = new String(document.inputForm.Email.value);
if(inputEmail.length==0){
sAlert += '* Email Address field required\n';
Correct = false;
}
}
if(sAlert.length>0){
Alert);
}
return Correct
}
</script>
 
New Post
3/1/2011 12:37 PM
 
If I remember correctly a form within a form will not work. If you look at the source of that dnn page you will see it.
 
New Post
3/1/2011 7:12 PM
 
You cannot do this sort of thing inside DNN or any asp.net based application for that matter.
Asp.net only permits one <form to exist on a site at any one time - and that <form is the form that dnn generates at the very core default.aspx page for your site.

About the only way that you could make this work directly would be using an IFRAME module pointed to a .html file that you copied the code into.

Westa
 
New Post
3/2/2011 6:46 AM
 
there is a workaround..

I built a module recently to post data to a payment gateway..

I used the method described in this post:

http://www.c-sharpcorner.com/uploadfile/desaijm/asp.netposturl11282005005516am/asp.netposturl.aspx

It's not perfect but it works.

"if the only tool you have is a hammer you tend to see every problem as a nail" http://www.carawaydesign.com
 
New Post
3/2/2011 9:13 AM
 
I think there is a JQuery plug-in which allows you to have more than one form and is pretty useful for DNN. Hope it helps someone. http://plugins.jquery.com/project/ezAjax

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Adding a scriptAdding a script


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out