We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1377
    • 8 Posts
    hi all

    i am using this code to display form in module manager

    $form=’
    <html>
    <head>
    <title>Bank Int. Rate Form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <form id="form" name="form" method="post" action="">
    <input type="hidden" name="intrate" value="yes" />

    <table>
    <tr>
    <td width="76">Bank Name:</td>
    <td width="130"><select id="bank_name" name="bank_name" eform="Bank::1:">
    <option>
    Please Select</option>
    <option value="Allahabad Bank">
    Allahabad Bank</option>
    <option value="Andhra Bank">
    Andhra Bank</option>
    <option value="Axis Bank">
    Axis Bank</option>
    <option value="Bank of Baroda">
    Bank of Baroda</option>
    <option value="Bank of India">
    Bank of India</option>
    <option value="Bank of Maharashtra">
    Bank of Maharashtra</option>
    <option value="Bank of Rajasthan">
    Bank of Rajasthan</option>
    <option value="Canara Bank">
    Canara Bank</option>
    <option value="Central Bank of India">
    Central Bank of India</option>
    <option value="Centurian Bank">
    Centurian Bank</option>
    <option value="Citibank">
    Citibank</option>
    <option value="Corporation Bank">
    Corporation Bank</option>
    <option value="DCB">
    DCB</option>
    <option value="Dena Bank">
    Dena Bank</option>
    <option value="Deutsche Bank">
    Deutsche Bank</option>
    <option value="Dhanalakshmi Bank">
    Dhanalakshmi Bank</option>
    <option value="Federal Bank">
    Federal Bank</option>
    <option value="HDFC Bank">
    HDFC Bank</option>
    <option value="HSBC">
    HSBC</option>
    <option value="ICICI Bank">
    ICICI Bank</option>
    <option value="IDBI">
    IDBI</option>
    <option value="Indian Bank">
    Indian Bank</option>
    <option value="Indian Overseas Bank">
    Indian Overseas Bank</option>
    <option value="IndusInd Bank">
    IndusInd Bank</option>
    <option value="Jammu and Kashmir Bank">
    Jammu and Kashmir Bank</option>
    <option value="Karur Vysya Bank">
    Karur Vysya Bank</option>
    <option value="Kotak Mahindra Bank">
    Kotak Mahindra Bank</option>
    <option value="Oriental Bank of Commerce">
    Oriental Bank of Commerce</option>
    <option value="Punjab and Sind Bank">
    Punjab and Sind Bank</option>
    <option value="Punjab National Bank">
    Punjab National Bank</option>
    <option value="SBI Commercial and International Bank Ltd">
    SBI Commercial and International Bank Ltd</option>
    <option value="South Indian Bank">
    South Indian Bank</option>
    <option value="Standard Chartered Bank">
    Standard Chartered Bank</option>
    <option value="State Bank of Bikaner and Jaipur">
    State Bank of Bikaner and Jaipur</option>
    <option value="State Bank of Hyderabad">
    State Bank of Hyderabad</option>
    <option value="State Bank of India">
    State Bank of India</option>
    <option value="State Bank of Indore">
    State Bank of Indore</option>
    <option value="State Bank of Mysore">
    State Bank of Mysore</option>
    <option value="State Bank of Patiala">
    State Bank of Patiala</option>
    <option value="State Bank of Saurashtra">
    State Bank of Saurashtra</option>
    <option value="State Bank of Travancore">
    State Bank of Travancore</option>
    <option value="Syndicate Bank">
    Syndicate Bank</option>
    <option value="UCO Bank">
    UCO Bank</option>
    <option value="Union Bank of India">
    Union Bank of India</option>
    <option value="United Bank of India">
    United Bank of India</option>
    <option value="Vijaya Bank">
    Vijaya Bank</option>
    </select>
    </td>
    </tr>
    <tr>
    <td rowspan="2">Loan Type</td>
    <td colspan="6"><div align="center">Years</div></td>
    </tr>
    <tr>
    <td>3 Years</td>
    <td >5 years</td>
    <td >7 years</td>
    <td >10 Years</td>
    <td >15 Years</td>
    <td >20 Years</td>
    </tr>
    <tr>
    <td>Car Loan (int rate p.a.) New Car</td>
    <td><input type="text" id="newcar_3yrs" name="newcar_3yrs" class="text" size="6" maxlength="5"/></td>
    <td><input type="text" id="newcar_5yrs" name="newcar_5yrs" class="text" size="6" maxlength="5"/></td>
    <td><input type="text" id="newcar_7yrs" name="newcar_7yrs" class="text" size="6" maxlength="5"/></td>
    </tr>
    <tr>
    <td>Used Car 3 years </td>
    <td><input type="text" id="usedcar_3yrs" name="usedcar_3yrs" class="text" size="6" maxlength="5"/></td>
    <td><input type="text" id="usedcar_5yrs" name="usedcar_5yrs" class="text" size="6" maxlength="5"/></td>
    </tr>
    <tr>
    <td></td>
    <td><input type="submit" id="submit" name="submit" value="submit"/></td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    ’;
    echo $form;

    my problem is when i run module it shows form but i dont know how to submit data from form to database table

    plz help me on this

      • 3749
      • 24,544 Posts
      You could re-do your form with eForm and use eForm2DB to send the data to the database.

      Or, you could put some php code in a snippet that would detect that the form has been submitted and use the MODx DBAPI to store the data yourself.

      You’ll probably need some understanding of PHP and SQL in order to make this work as you want it to.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting