Regd.updation of field into database.....Need help

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
joinnavdev
Forum Newbie
Posts: 21
Joined: Thu Feb 05, 2015 2:34 pm

Regd.updation of field into database.....Need help

Post by joinnavdev »

Hi All,

Appreciate help with the below issue......I am trying to display the employee details & giving option to update the records also, everything is working fine but Joining Date display/changes are fine but records are not getting updated.

Please find the code below........

Code: Select all

		<form id="personal_info" name="personal_info" method="post" action="javascript:void(0);" enctype="multipart/form-data">
        <input type="hidden" name="update_id" value="{$sm.res.id_employee}" id="upd_id">
		<table border="0" width="95%" class="mrgtp0" align="center">
					<td>Date of Birth:</td>
                        <td align="left">
                            <span class="detail">{if $sm.res.dob eq '0000-00-00'}NA{else}{$sm.res.dob|date_format:'%d-%m-%Y'}{/if}</span>
                            <span class="edit_detail">
                                <input type="text" name="dob" value="{if $sm.res.dob eq '0000-00-00'}{else}{$sm.res.dob|date_format:'%d-%m-%Y'}{/if}" id="dob" class="text"/>
                            </span>
                        </td>
                    </tr>
					<tr>
                        <td>Joining Date:</td>
                        <td align="left">
                            <span class="detail">{if $sm.res.joined_date eq '0000-00-00'}NA{else}{$sm.res.joined_date|date_format:'%d-%m-%Y'}{/if}</span>
                            <span class="edit_detail">
                                <input type="text" name="joined_date" value="{if $sm.res.joined_date eq '0000-00-00'}{else}{$sm.res.joined_date|date_format:'%d-%m-%Y'}{/if}" id="joined_date" class="text"/>						
                            </span>
                        </td>
                    </tr>
					
					<span class="detail">
                                <input type="button" name="edit" value="Edit" onclick="editDetail();" class="login_btn">
                            </span>
                            <span class="edit_detail">
                                <input type="button" name="save" value="Save" onclick="saveEmployee();" class="login_btn">        
							</span>
		</table>
		 </form>
		 
		 <script type="text/javascript">
		 function saveEmployee(){	
			var res = personalInfo();
			cShowActivity('1');
			document.personal_info.action="##LBL_SITE_URL##index.php/employee/updateEmployee";
			if(res){		
				document.personal_info.submit();
			}else{
				var res = personalInfo();
			}
			}
		</script>

Appreciate the help in resolving the above issue.

Thanks,
Nick
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Regd.updation of field into database.....Need help

Post by requinix »

None of this actually does any saving. It's just a form. If the changes are not saving then you have to look at the place that actually does the saving - that's whatever code "index.php/employee/updateEmployee" corresponds to.
joinnavdev
Forum Newbie
Posts: 21
Joined: Thu Feb 05, 2015 2:34 pm

Re: Regd.updation of field into database.....Need help

Post by joinnavdev »

Hi,

You are right but that I checked earlier only but couldn't identify the issue as in root no employee folder exist where I am getting confusing.....

Anyhow I resolved the issue but really thanks for looking into my issue & your help to resolve the problem is highly appreciated.

Thanks,
Nick
Post Reply