css + js float(浮点数) regxp(正则表达式检测)
关键字: js + css<script>
function submitform(){
var ourprice = $('channel_our_price').value;
var marketprice = ourprice + 0.000001
if (false){}
<% if "sourcingmap" != edit_channel_name %>
marketprice = $('channel_market_price').value;
if( !ckeckFloat('channel_market_price') || marketprice <= 0){
alert('market price must be greater than zero.');
focusOnEdit('channel_market_price');
}
<% end %>
else if (!ckeckFloat('channel_our_price') || ourprice <= 0 ) {
alert ('our price must be greater than zero .');
focusOnEdit('channel_our_price');
}else if(parseFloat(ourprice) > parseFloat(marketprice)){
alert('market price must be greater than or equal to our price.');
focusOnEdit('channel_market_price');
}else{
$('channel_our_price').form.submit();
}
}
function ckeckFloat(elementId){
var inId1 = $(elementId);
var inId1_value = inId1.value
//float regular expresion
var re = /^[0-9]*\.?[0-9]+$/
var result = re.exec(inId1_value);
if (result != null){//" null" is stand for matching failure of regular Expression.
return true;
}else{
return false;
}
}
</script>
评论
.class_name *{
//color;
font:normal normal normal medium normal "Times New Roman";
letter-spacing:normal;
line-height:normal;
//list-style:disc outside none;
text-align:left;
text-indent:0;
text-transform:none;
white-space:normal;
word-spacing:normal;
//margin:0 0;
padding:0;
}
[title] { color: blue;background-color:; }
.class_name td{
padding:1;
}
li {
color:red;
//list-style:none;
}
</style>







评论排行榜