Commit 81ff9370 authored by smestry's avatar smestry

Updated js for the Product wizard for minor bugs.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@102063 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fa39260c
......@@ -477,3 +477,41 @@
$(this).toggleClass('collapse');
return false;
});*/
// Changed by Sneha on 23-06-2016 for special character [Start]
function specialCharValidate(id)
{
//alert(id);
if (isValidCharacter(id) == false)
{
alert("Please enter valid character. No special character allowed.");
return false;
}
}
function isValidCharacter(txtTitle)
{
var title = document.getElementById(txtTitle);
//var regExp = /^[a-zA-Z]*$/
//var regExp = /^[a-zA-Z\-\s]+$/
function isValidCharacter(txtTitle)
{
var title = document.getElementById(txtTitle);
var regExp = /^[!@#$^&*()_+{}"<>?.,';\][=-`0-9a-zA-Z\-\s]+$/
//var regExp = /^[%:~]+$/
if (!regExp.test(title.value) && title.value != "")
{
//title.value = '';
var val = document.getElementById(txtTitle).value;
var val1 = val.substring(0, val.length - 1);
title.value = val1;
return false;
}
else
{
return true;
}
}
}
// Changed by Sneha on 23-06-2016 for special character [End]
\ No newline at end of file
......@@ -851,7 +851,8 @@
"<input type='hidden' id=itemcode"+no+" value='' />" +
"<lable id=lblLangs"+no+">"+ langCode +"</lable></td>"+
"<td>" +
"<input type='text' id=langDesc"+no+" class='editInputClass' size='10' MAXLENGTH='85' style='width: 100%' value='' />" +
"<input type='text' id=langDesc"+no+" class='editInputClass' size='10' MAXLENGTH='85' style='width: 100%' value='' " +
"onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"</tr>"
);
......@@ -1380,15 +1381,18 @@
"</td>" +
"<td width='5%'>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langCodeDesc"+num+" size='30' MAXLENGTH='85' style='text-align: right;'/>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langCodeDesc"+num+" size='30' MAXLENGTH='85' " +
"style='text-align: right;' onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"<td width='5%'>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langShDesc"+num+" size='25' MAXLENGTH='100' style='text-align: right;'/>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langShDesc"+num+" size='25' MAXLENGTH='100' " +
"style='text-align: right;' onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"<td width='5%'>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langLongDesc"+num+" size='25' MAXLENGTH='490' style='text-align: right;'/>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langLongDesc"+num+" size='25' MAXLENGTH='490' " +
"style='text-align: right;' onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"</tr>"
......@@ -1480,8 +1484,8 @@
var itemDescr = new Array();
var count = 0;
alert("maxId===>>"+maxId);
alert("rowId===>>"+rowId);
//alert("maxId===>>"+maxId);
//alert("rowId===>>"+rowId);
//var rowId = (rowId=="") ? rowId=="0" : rowId;
......@@ -1598,8 +1602,12 @@
{
if(barCodes[i]==curBarCode)
{
alert("Please Enter Different Barcode for Product '"+ document.getElementById("Detail"+formNo+"."+dbID+".descr").value +"'.");
// Changed by Sneha on 23-06-2016 for alert message of Barcode [Start]
// alert("Please Enter Different Barcode for Product '"+ document.getElementById("Detail"+formNo+"."+dbID+".descr").value +"'.");
alert("Duplicate Barcode found. Please Enter Different Barcode for the Product '"+ document.getElementById("Detail"+formNo+"."+dbID+".descr").value +"' '"+ document.getElementById("Detail"+formNo+"."+dbID+".item_barcode").value +"'.");
document.getElementById("Detail"+formNo+"."+dbID+".item_barcode").focus();
return false;
// Changed by Sneha on 23-06-2016 for alert message of Barcode [End]
}
}
barCodes.push(document.getElementById("Detail"+formNo+"."+dbID+".item_barcode").value);
......@@ -1754,7 +1762,7 @@
//alert("itemCode---"+itemCode);
itmparntChangeNew(itemCode, "GET_ITEM_DESCR");
//alert("valueFromServlet---"+valueFromServlet);
//alert("valueFromServlet for GET_ITEM_DESCR --->>"+valueFromServlet);
var chkbox = "Y";
var row = "<tr>"
......@@ -1775,16 +1783,16 @@
+"</td>"
// Item Description
+ "<td>"
+"<input type='text' class='editInputClass' value='"+valueFromServlet+"' name='Detail3."+maxRowId+".descr' "
+"id='Detail3."+maxRowId+".descr' maxlength='90' style='width: 100%;' />"
+"<input type='text' class='editInputClass' value=\""+valueFromServlet+"\" name='Detail3."+maxRowId+".descr' "
+"id='Detail3."+maxRowId+".descr' maxlength='90' style='width: 100%;' ISCHANGED='false' readOnly = '1'/>"
+"<input type='hidden' class='editInputClass' name='Detail3."+maxRowId+".item_code' "
+"id='Detail3."+maxRowId+".item_code' maxlength='10' style='width: 100%;'/>"
+"id='Detail3."+maxRowId+".item_code' maxlength='10' style='width: 100%;' />"
+"</td>"
// Limited Edition
+"<td style='text-align:center;'>"
+"<select name='Detail3."+maxRowId+".usage_type' id='usage_type' >"
+"<select name='Detail3."+maxRowId+".usage_type' id='usage_type' autofocus = 'true'>"
+"<option value='N' selected='selected'>No</option>"
+"<option value='Y'>Yes</option>"
+"</select>"
......@@ -2108,6 +2116,37 @@
}*/
// Changed by Sneha on 23-06-2016 for special character [Start]
function specialCharValidate(id)
{
//alert(id);
if (isValidCharacter(id) == false)
{
alert("Please enter valid character. No special character allowed.");
return false;
}
}
function isValidCharacter(txtTitle)
{
var title = document.getElementById(txtTitle);
var regExp = /^[!@#$^&*()_+{}"<>?.,';\][=-`0-9a-zA-Z\-\s]+$/
//var regExp = /^[%:~]+$/
if (!regExp.test(title.value) && title.value != "")
{
//title.value = '';
var val = document.getElementById(txtTitle).value;
var val1 = val.substring(0, val.length - 1);
title.value = val1;
return false;
}
else
{
return true;
}
}
// Changed by Sneha on 23-06-2016 for special character [End]
\ No newline at end of file
......@@ -137,15 +137,18 @@
"</td>" +*/
"<td width='5%'>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langCodeDesc"+num+" size='30' MAXLENGTH='90' style='text-align: right;'/>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langCodeDesc"+num+" size='30' MAXLENGTH='90' " +
"style='text-align: right;' onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"<td width='5%'>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langShDesc"+num+" size='25' MAXLENGTH='100' style='text-align: right;'/>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langShDesc"+num+" size='25' MAXLENGTH='100' " +
"style='text-align: right;' onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"<td width='5%'>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langLongDesc"+num+" size='25' MAXLENGTH='490' style='text-align: right;'/>" +
"<input type='text' class='editInputClass' style='text-align: left;' id=langLongDesc"+num+" size='25' MAXLENGTH='490' " +
"style='text-align: right;' onkeyup = 'return specialCharValidate(this.id);' />" + /* Added by Sneha on 23-06-2016 for input of special character */
"</td>"+
"</tr>"
......
......@@ -756,7 +756,11 @@
{
if(barCodes[i]==curBarCode)
{
alert("Please Enter Different Barcode for Product '"+ document.getElementById("Detail2."+dbID+".item_descr").value +"'.");
// Changed by Sneha on 23-06-2016 for alert message of Barcode [Start]
//alert("Please Enter Different Barcode for Product '"+ document.getElementById("Detail2."+dbID+".item_descr").value +"'.");
alert("Duplicate Barcode found. Please Enter Different Barcode for the Product '"+ document.getElementById("Detail2."+dbID+".item_descr").value +"' '"+ document.getElementById("Detail2."+dbID+".item_barcode").value +"'.");
document.getElementById("Detail2."+dbID+".item_barcode").focus();
// Changed by Sneha on 23-06-2016 for alert message of Barcode [End]
return false;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment