2013年12月4日 星期三

html-validate



<!DOCTYPE html>
<html>
<head>
<script>
function validateForm()
{
var x=document.forms["myForm"]["email"].value;
var atpos=x.indexOf("@");
var dotpos=x.lastIndexOf(".");
if (atpos<1 || dotpos<atpos+2 || dotpos+2>=x.length)
  {
  alert("Not a valid e-mail address");
  return false;
  }
}
</script>
</head>

<body>
<form name="myForm" action="demo_form.asp" onsubmit="return validateForm();" method="post">
Email: <input type="text" name="email">
<input type="submit" value="Submit">
</form>
</body>

</html>

jquery-option select ADD and REMOVE

javascript-combo
javascript-select-option


$( "#password" ).blur(function() {
s0=_lookup('username');
s1=_lookup('password');
s='tableRead?db=hr&table=USER&fields=COMPANY_NAME&where=where '+
'login_id:`'+s0+'` and password:sha(`'+s1+'`) &format=S&callback=?';
$.getJSON(s,
 function(data) {
 if (data[0]){
$("#companyname").removeAttr("disabled");
$('#companyname').find('option').remove().end()  //combo clear combo-clear 
for (r=0; r<data.length; r++){
var o = new Option(data[r][0],data[r][0] );
$(o).html(data[r][0]);
$("#companyname").append(o);
}
  }  else {
$('#companyname').find('option').remove().end().append('<option value=""></option>').val('');
$("#companyname").attr( "disabled", "disabled" );
  }
 }
);
});



jquery-disable jquery-enable password verify

$("#pgdnButton,#pgupButton").removeAttr('disabled');
if(reccount*1<=limit*1) $("#pgdnButton,#pgupButton").each(function() {this.disabled='disabled';});



/*****************************************************************/

javascript-enable
jquery disable
jquery enable


$( "#password" ).blur(function() {
s0=_lookup('username');
s1=_lookup('password');
s='tableRead?db=hr&table=USER&fields=COMPANY_NAME&where=where '+
'login_id:`'+s0+'` and password:sha(`'+s1+'`) &format=S&callback=?';
$.getJSON(s,
 function(data) {
 if (data[0]){
$("#companyname").removeAttr("disabled");
  }  else {
$("#companyname").attr( "disabled", "disabled" );
  }
 }
);
});

ERP-WIP



Work in process (WIP)If a job runs over a long period, you may want to transfer these costs to a Work In Process (WIP) account on the balance sheet while the job is being completed. You can then recognize the costs and sales in your income statement accounts when it  is appropriate. You can calculate the value of the WIP of your jobs.  The calculation is based on the WIP method selected on individual jobs.

• Cost value: It starts by calculating the value of what has been provided by taking a proportion of the estimated total costs, based on the percentage of completion. Invoiced costs are subtracted by taking a proportion of the estimated total costs, based on the invoiced percentage.

• Cost of sales: It begins by calculating the recognized costs. Costs are recognized proportionally based on scheduled total costs.

• Sales value: It recognizes revenue proportionally based on the usage total costs and the expected cost recovery ratio.

• Percentage of completion: It recognizes revenue proportionally based on the percentage of completion, that is, the usage total costs against schedule costs.

• Completed contract: Completed contract does not recognize revenue and costs until the job is complete. You may want to do this when there is high uncertainty about the estimates of costs and revenue for the job.The system also allows you to create your own job WIP method that reÁects the needs of your organization.

2013年12月3日 星期二

linux-grep




 grep PURCHASE_HEADER_BAK * | grep TIMESTAMP

-
grep 2 constrain
grep jdbc:mysql *.java | grep hr  > abcd.txt

-

2013年12月2日 星期一

foxpro-javabean

function createbean()

select gendao
_delimiter=''
quota='"'
quota2="+"
r0=''
r1=''
r=''
store ''  to mclassname
scan
if ztype='TABLE'
r= r+'import java.util.Date;'+chr(13)
r=r+'public class '+allt(classname)+"{"+chr(13)
store allt(classname) to mclassname
else
r0=r0+" protected " + allt(javatype)+" "+allt(varname)+";"+chr(13)
r1=r1+"public void set"+allt(classname)+"("+allt(javatype)+" newValue){"+allt(varname)+" = newValue;}"+chr(13)
r1=r1+"public "+allt(javatype)+" get"+allt(classname)+"(){return "+allt(varname)+";}"+chr(13)+chr(13)
endif
endscan
r=r+r0+chr(13)
r=r+"public "+mclassname+"(){}"+chr(13)
r=r+r1+chr(13)+"}"
return r

2013年12月1日 星期日

javascript-modal subform

javascript-call-subform.

Step
  1. <link href="css/modalPopLite.css" rel="stylesheet" type="text/css" />
  2. <script src="js/modalPopLite.js" type="text/javascript"></script>
  3. <div id="clicker"></div>
    <div id="popup-wrapper"> <!--modal box-->
    <iframe width="100%" height="100%"
    name="moralFrame" id="moralFrame"
    src="#"
    frameborder="0" >
    </iframe>
    <a href="#" id="close-btn" style="display:none;">Close</a>
    </div>
  4. <script>
    $(function () {
    $('#popup-wrapper').modalPopLite({ openButton: '#clicker', closeButton: '#close-btn', isModal: true });
    });
    function exitMoralBox(string){
    $('#close-btn').click(); }
    </script>
  5. onclick="$('#popup-wrapper').width(1080).height(600);
    s1='';
    s='input9.jsp?input=companyProfileInput.txt&config=companyProfileInputConfig.txt&mode=DUMMY'; $('#moralFrame').prop('src', s);
    $('#clicker').click(); "