DNN Form in the text/HTML module

Posted on 2008-06-15
Last Modified: 2012-06-27

I am trying to run a form in the text/html module. On a basic HTML page it works just fine. How do I change it so it runs in the module.

I believe I have to change the

<input type="button" value="  Calculate  " onClick="mmcalculate(this.form)">

to something that ASP.NET can understand.



<!-- Begin

function calculate(form) {

brgdiam =eval(form.bearing_diam.value)

breadth =eval(form.breadth.value)

form.mmbearing_diam.value=brgdiam * 25.40005

form.mmbreadth.value =breadth * 25.40005

c = (brgdiam * breadth * 1.29)/7

form.result.value = c

form.mmresult.value =c


function mmcalculate(form) {

mmbrgdiam =eval(form.mmbearing_diam.value)

mmbreadth =eval(form.mmbreadth.value)

form.bearing_diam.value=mmbrgdiam * 0.03937

form.breadth.value =mmbreadth * 0.03937

mmc = ((mmbrgdiam * 0.03937) * (mmbreadth * 0.03937) * 1.29) / 7

form.result.value =mmc

form.mmresult.value = mmc


// End -->


<form method="post" action="" name="form1">

<table width="100%" border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff">


    <td width="43%" align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Bearing 

    <b>outside</b> diameter :</font></td>

    <td width="27%"> 

    <input type="text" name="mmbearing_diam" size="6">

    <font face="Verdana, Arial, Helvetica, sans-serif" size="2">mm</font> 


    <td width="30%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 

    <input type="text" name="bearing_diam" size="6" maxlength="6">   inch(es) </font></td>



     <td width="43%" align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Breadth :</font></td>

     <td width="27%"> 

     <input type="text" name="mmbreadth" size="6">

     <font face="Verdana, Arial, Helvetica, sans-serif" size="2">mm 


     <td width="30%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 

     <input type="text" name="breadth" size="6" maxlength="6">inch(es)</font></td>



      <td width="43%" align="right"><font size="2" color="#660000">..</font></td>

      <td width="27%"> 

      <input type="button" value="  Calculate  " onClick="mmcalculate(this.form)">


      <td width="30%"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 

      <input type="button" value="  Calculate  " onClick="calculate(this.form)">




      <td width="43%" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Result: </font></td>

      <td width="57%" colspan="2"> 

      <div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 

      <input type="text" name="result" maxlength="12" size="12" READONLY>cc per day</font></div>





Open in new window

Question by:sdeby
1 Comment
LVL 29

Accepted Solution

David H.H.Lee earned 500 total points
ID: 21795319
Dear sdeby,

I noticed there are missing 2 controls here: result and mmresult.
Perhaps these controls is textbox? Please check first.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now