custom form

All the topics other than the two goes here.
  • Ads

custom form

Postby xmccay » Thu Oct 29, 2009 10:24 am

Hi,

I was trying to create a custom join form and post all the data into the database by setting the form action to join.php but why my form is not working? Even the photo can be processed and uploaded. I think I have used the correct variables since I get the form elements name by viewing the source code of join,php page.

Can somebody please let me know how i can make my custom form works with the system existing membership registration script? My html form as below. Thanks. Or is the captcha giving problem to me or my elements name are not correct ?

Code: Select all

<form  id="join_form" enctype="multipart/form-data" onsubmit="return validateJoinForm(this);" method="post" action="/join.php" name="join_form">      <script type="text/javascript" language="javascript">
         $(document).ready( function(){ //onload
            
            //apply counters to textareas
            $( 'textarea.input_area' ).each( function() {
               function setCounter() {
                  if( $area.val() )
                     $counter.show( 300 );
                  else
                     $counter.hide( 300 );
                  
                  $counterCont.html( $area.val().length );
               }
               
               var $area = $(this);
               $area.after(
                  '<div class="counter" style="display:none;">Counter: <b></b></div>'
               );
               
               var $counter = $area.siblings('div.counter')
               var $counterCont = $counter.children('b');
               
               setCounter();
               $area.change( setCounter ).keyup( setCounter );
            } );
         } );
      </script>
      <input type="hidden" name="join_page" value="done" /><table  id="join_form_table" cellspacing="0" cellpadding="0" border="0"><tr class="headers"><th class="header form_second_col" style="display: none;">&nbsp;</th><th class="header form_second_col" style="display: none;">First Person</th></tr><tr><th class="block" colspan="2">General Info</th></tr><tr>
<th class="label">Username: <span class="form_mandatory">*</span>

         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Select username which will be used for logging in to the site');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="text" class="input_text" name="NickName[0]" value="" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr>
<th class="label">Full name:
         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Enter you full name here');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="text" class="input_text" name="Full_Name[0]" value="" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr>
<th class="label">Email: <span class="form_mandatory">*</span>
         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Enter your Email. Your password will be sent to this email.');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="text" class="input_text" name="Email[0]" value="" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr>
<th class="label">Password: <span class="form_mandatory">*</span>

         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Please specify your password. It will be used for logging in to the site. This storage is secure, because we are using an encrypted format.');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="password" class="input_pass" name="Password[0]" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr>
<th class="label">Confirm password: <span class="form_mandatory">*</span>
         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Enter the same password here');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="password" class="input_pass" name="Password_confirm[0]" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr>
  <th class="label">State: </th>
  <td><input type="text" class="input_text" name="State[0]" value="" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr>
<th class="label">City: <span class="form_mandatory">*</span>

         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Enter the name of the city where are you living');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="text" class="input_text" name="City[0]" value="" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr><th class="block" colspan="2">My Photo</th></tr><tr>
<th class="label">Upload Profile Photo: <span class="form_mandatory">*</span>
         <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Upload Profile Photo');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
<td><input type="file" size="23" class="" name="photo"/><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr><th class="block" colspan="2">Miscellaneous Info</th></tr>
<tr>
  <th class="label">Languages spoken:
    <img class="form_info_icon" src="http://www.mysite.com/templates/tmpl_uni/images/icons/info.gif"
           onmouseover="showFloatDesc('Enter your main language');"
           onmousemove="moveFloatDesc( event )" onmouseout="hideFloatDesc()" /></th>
  <td><input type="text" class="input_text" name="Lang_Spoken[0]" value="" /><img src="http://www.mysite.com/templates/tmpl_uni/images/icons/warn.gif" class="form_warn_icon" style="display: none;" onmousemove="moveFloatDesc(event)" onmouseout="hideFloatDesc()" /></td></tr>
<tr><th class="block" colspan="2">&nbsp;</th></tr>
<tr>
  <td colspan="3" class="form_row_special">
   
    <input type="checkbox" name="TermsOfUse" value="yes" id="TermsOfUse_agree" />
    <label for="TermsOfUse_agree">
      I have read and agreed with <a href="terms_of_use.php" target="_blank">terms of use</a>.</label></td></tr>
<tr><th class="bottom_controls" colspan="2"><input  type="submit" value="Submit" class="input_submit" /></th></tr></table></form>



Thank you very much.
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

Re: custom form

Postby Administrator » Thu Oct 29, 2009 4:48 pm

These javascripts are needed for when you use counter with textarea.

Also, you need to include jquery if you are using this.

To add captcha.

add the following code:

Code: Select all
<img src="simg/simg.php" alt="secCode" >
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: custom form

Postby xmccay » Fri Oct 30, 2009 6:14 pm

It doesn't seem to work =(

Which file should we go and check which tables the new records will be inserted upon registration ? I don't see any function to upload and optimize the uploaded image.

Please advise. thanks
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

Re: custom form

Postby Administrator » Sat Oct 31, 2009 5:58 pm

its done by inc/classes/BxDolProfilesController.php
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

Re: custom form

Postby xmccay » Wed Nov 04, 2009 7:43 am

Hi,

During the registration, is it the join now form only perform the following ;
- insert data into Profiles table
- resize the images uploaded to 3 different sizes and store in the user media folder
- insert a record into media table to capture the resized file name.

Did I miss anything from my registration form ? Please advise.

Thank you
xmccay
Jr. Member
Jr. Member
 
Posts: 195
Joined: Sat Nov 01, 2008 3:42 pm

Re: custom form

Postby Administrator » Wed Nov 04, 2009 4:04 pm

Yes, its the same. It performs it by respective classes.
Regards,
Praveen
Administrator
Administrator
Administrator
 
Posts: 1069
Joined: Mon Aug 25, 2008 7:18 am
Location: India

  • Ads

Return to Dolphin General Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron