/    Sign up×
Community /Pin to ProfileBookmark

Save button suddenly not working :( please help

“The issue about is modifying/editing the information using save button,
Recently the “save button” is 100% functioning a year ago. but suddenly its just not working anymore no response for save button I dont know what happened”

here’s the image
[ATTACH]16427[/ATTACH]

The save button will not work when Wage (Full time wage / hourly wage) is going to be edited.
other text field except on wage , save button is working fine.

Here’s the code

[CODE]
<script language=”Javascript”>
function formchk() {
frm = document.frm1;

if(frm.employee_id.value ==””) {
alert(“Please, Insert employee id!”);
frm.employee_id.focus();
return;
}
if(frm.first_name.value ==””) {
alert(“Please, Insert first name!”);
frm.first_name.focus();
return;
}

if(frm.last_name.value ==””) {
alert(“Please, Insert last name!”);
frm.last_name.focus();
return;
}

if(frm.current_ft_wage.value == “”) {
alert(“Please, Insert full time wage!”);
frm.current_ft_wage.focus();
return;
}

if(frm.current_hr_wage.value ==””) {
alert(“Please, Insert hourly wage!”);
frm.current_hr_wage.focus();
return;
}

frm.submit();

}

<?php if ($action_type <> ”) { ?>
$(“.current_ft_wage”).click(function() {
var eid = $(“#eid”).val();
var wtype = “f”;
left1 = (screen.width/2)-(500/2);
top1 = (screen.height/2)-(500/2);
new_window = window.open(‘add_wage.php?eid=’+eid+’&wtype=’+wtype,”,’width=500,height=500,top=’+top1+’,left=’+left1);
if (window.focus) {
new_window.focus();
}
return false;
});

$(“.current_hr_wage”).click(function() {
var eid = $(“#eid”).val();
var wtype = “h”;
left1 = (screen.width/2)-(500/2);
top1 = (screen.height/2)-(500/2);
new_window = window.open(‘add_wage.php?eid=’+eid+’&wtype=’+wtype,”,’width=500,height=500,top=’+top1+’,left=’+left1);
if (window.focus) {
new_window.focus();
}
return false;
});
<?php }?>
});
</script>

<!– CONTENTS ——————————————————————————————–>

</td>
</tr>
<form name=”frm1″ method=”post” action=”employee_regist_ok.php”>
<input type=”hidden” name=”action_type” value=”<?=$action_type?>”>

<tr>
<td valign=”top”>
<?php
if ($action_type <> “” && $list_Records[0][“termination_date”] <> “0000-00-00” && $list_Records[0][“termination_date”] < $now_dateano) {
?>
<div class=”ui-state-highlight ui-corner-all” style=”margin-top: 10px; margin-bottom:10px; padding: 0 .7em;”>
<p><span class=”ui-icon ui-icon-info” style=”float: left; margin-right: .3em;”></span>
<strong>Terminated!</strong></p>
</div>
<?php } ?>
<span><span class=”mandatory”>*</span> Mandatory fields</span>
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”1000″ class=”new_entry”>
<thead>
<tr>
<th><span class=”mandatory”>*</span>Hire Date</th>
<th><span class=”mandatory”>*</span>Employee ID<? if($action_type!=”modify”) { ?> <button id=”employee_generate_id”><span class=”ui-icon ui-icon-pencil”></span></button><br/> <?}?></th>
<th><span class=”mandatory”>*</span>First Name</th>
<th><span class=”mandatory”>*</span>Last Name</th>
<th><span class=”mandatory”>*</span>D.O.B.</th>
</tr>
</thead>
<tbody>
<tr>
<td ><input type=”text” name=”hire_date” id=”hire_date” size=”10″ value=”<?php echo getAUDate($list_Records[0][‘hire_date’]);?>” /></td>
<td><input type=”text” size=”20″ id=”employee_id” name=”employee_id” <?if($action_type==”modify”) echo “readonly=’readonly’ ” ?> value=”<?=$list_Records[0][“employee_id”]?>”>

</td>
<input type=”hidden” name=”id” id=’eid’ value=”<?php echo $list_Records[0][‘id’];?>”>
<td><input type=”text” size=”15″ name=”first_name” value=”<?=$list_Records[0][“first_name”]?>”> </td> <td><input type=”text” size=”15″ name=”last_name” value=”<?=$list_Records[0][“last_name”]?>”> </td>
<td><input type=”text” name=”dob” id=”dob” size=”10″ value=”<?php echo getAUDate($list_Records[0][‘dob’]);?>” /> </td>
</tr>
</tbody>
</table>
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”1000″ class=”new_entry”>
<thead>
<tr>
<th><span class=”mandatory”>*</span>Phone/Mobile</th>
<th><span class=”mandatory”>*</span>Full time wage</th>
<th><span class=”mandatory”>*</span>Hourly wage</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type=”text” size=”15″ name=”phone_number” value=”<?=$list_Records[0][“phone_number”]?>”>
</td>
<td id=’current_ft’>
<input type=’text’ name=’current_ft_wage’ <?php if ($action_type <> ”) echo ” readonly=’readonly’ “;?> class=’current_ft_wage’ size=’6′ value='<?php echo getValue(‘wages’,’wages_amount’,” and wages_id = ‘”.$list_Records[0][‘current_ft_wage_id’].”‘ “)?>’>

</td>

<td id=’current_hr’>
<input type=’text’ name=’current_hr_wage’ <?php if ($action_type <> ”) echo ” readonly=’readonly’ “;?> size=’6′ class=’current_hr_wage’ value='<?php echo getValue(‘wages’,’wages_amount’,” and wages_id = ‘”.$list_Records[0][‘current_hr_wage_id’].”‘ “)?>’>
<input type=’hidden’ name=’current_hr_wage_id’ id=’current_hr_wage_id’ value='<?php echo $list_Records[0][‘current_hr_wage_id’];?>’ >
</td>

</tr>
</tbody>
</table>

<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”1000″ class=”new_entry”>
<thead>
<tr>
<th>Payment Type</th>
<th>Account Name</th>
<th>BSB</th>
<th>Account Number</th>
</tr>
</thead>
<tbody>
<tr>

<?php if($action_type) { ?>
<table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”1000″ class=”new_entry”>
<thead>
<tr>
<th><span id=”history”>History</span>&larr;click to see history</th>
</tr>
</thead>
<tbody id=”history_details” style=”display:none;”>
<tr >
<td class=’right’ >Inserted by&nbsp;<?php echo getValue(‘account’, ‘username’, ‘ AND userid=”‘.$list_Records[0][‘account_id’].'”‘)?>&nbsp;<?php echo getAUDate($list_Records[0][“regdate”],1)?>

<br>
<div class=”right”>
<input type=”button” value=”Save” onclick= “formchk();”>
<input type=”button” value=”Delete” onclick=”javascript:if(confirm(‘Are you sure?’)) { location.href='<?=$_SERVER[‘PHP_SELF’]?>?id=<?=$list_Records[0][“id”]?>&action_type=delete’;}”>
</div>
</td>
</tr>
</form>
[/CODE]

When you will click the (Full Time wage / hourly wage)
another window form will occur, letting you to choose the wage you wanted , by clicking the desired amount of
wage, and it will automatically link to the textbox of main form. (Wage form window will automatically close after selecting the desired amount)

here’s the image

[ATTACH]16429[/ATTACH]

After edting the wage, and will click the save button
“save buttong got no response”

Heres the code for Wage form window

[CODE]<?php

<script type=”text/javascript” language=”javascript”>
$(document).ready(function() {
$(window.opener.document).find(‘body’).attr(‘disabled’,’disabled’);

$( “input:button, button”).button();
$(“#apply_date”).datepicker($.datepicker.regional[‘en-GB’]);
$(“#apply_date”).datepicker( “option”, “firstDay”, 1 );
$(“#apply_date”).datepicker();

$(‘.choose’).click(function() {

// Populate the text box on the parent form with value “hello”:
<?php if ($wtype == ‘f’) { ?>
$(window.opener.document).find(‘#current_ft’).html(“<input type=’text’ name=’current_ft_wage’ readonly=’readonly’ size=’6′ class=’current_ft_wage’ value='”+$(this).text()+”‘><input type=’hidden’ name=’current_ft_wage_id’ value='”+$(this).attr(‘id’)+”‘ > “);
<?php } else if($wtype == ‘h’) { ?>
$(window.opener.document).find(‘#current_hr’).html(“<input type=’text’ name=’current_hr_wage’readonly=’readonly’ size=’6′ class=’current_hr_wage’ value='”+$(this).text()+”‘><input type=’hidden’ name=’current_hr_wage_id’ value='”+$(this).attr(‘id’)+”‘ > “);
<?php } ?>

// Close the window
window.close();
});
});

$(window).unload(function() {
window.opener.document.body.disabled=false;
//$(window.opener.document).find(‘body’).attr(‘disabled’,’false’);
});

function form_submit() {
frm = document.wages_frm;
frm.action_type.value = ‘add’;
frm.submit();

}

[/CODE]

Thank you so much guys, please help me with my big problem…
I don’t know what happened with this. ?

[canned-message]attachments-removed-during-migration[/canned-message]

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@HotAirDragonauthorNov 05.2014 — I just cut the other code since the maximum length of word here is just 10000
×

Success!

Help @HotAirDragon spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...