1. Pass the value between frames:
Function ddlchangeid_onhanged (OBJ ){
VaR FF = Document. Forms [0];
// Obtain all frames
VaR objframes = parent. frames;
VaR changevalue = obj. value;
// Get frame 1, a text box
VaR obj_jan = objframes%02.16.doc ument. getelementbyid ("saleinputarea1_txtinputjanid ");
If (changevalue! = ""){
// Set the text box in another framework to writable.
Obj_jan.readonly = false;
// Set the class of the style in the text box
Obj_jan.classname = "textbox0w ";
Obj_jan.value = "";
// Set the buttons of the current framework to be available.
Ff. btninput. Disabled = false; // log on to Alibaba Cloud
}
Else
{
Obj_jan.classname = "textbox0r ";
Obj_jan.readonly = true;
Ff. btninput. Disabled = true; // log on to Alibaba Cloud
}
}
2. Table
/*
* Double-click the function called by the selected row, and fill some data of the selected row in the text box that makes a fram
Rowobj: Row object of table
Rowindex: row number
*/
Function gridrowdblclick (rowobj, rowindex)
{
VaR objframes = parent. frames;
VaR obj_jan = objframes%02.16.doc ument. getelementbyid ("saleinputarea1_txtinputjanid ");
VaR obj_mac = objframes%02.16.doc ument. getelementbyid ("saleinputarea1_txtmac ");
VaR obj_xian = objframes%02.16.doc ument. getelementbyid ("saleinputarea1_txtxian ");
VaR FF = Document. Forms [0];
VaR rtnvalue = "";
VaR rtnarray = new array ();
Obj_jan.readonly = true;
Obj_jan.classname = "textbox0r ";
Obj_jan.value = rowobj. cells [1]. innerhtml; // The subscript of cells starts from scratch.
Obj_mac.readonly = true;
Obj_mac.classname = "textbox0r ";
Obj_mac.value = rowobj. cells [2]. innerhtml;
// Obtain detailed information through backend Ajax (db operation)
Rtnvalue = getreturngoodsdetail (rowobj. cells [0]. innerhtml );
If (rtnvalue! = "")
{
Obj_xian.value = rtnvalue
}
Gridrowonmouseselected (rowobj, rowindex); // record the selected row and set its style
}
/*
* Events when the mouse leaves the selected row
*/
Function gridrowonmouseselected (rowobj, rowindex)
{// Obtain the table object
VaR parentobj = rowobj. parentnode;
// Alert (parentobj. innerhtml );
If (selectedrowid> = 0)
{
Parentobj. Rows [selectedrowid]. classname = "gridonmouseout ";
}
Rowobj. classname = "gridonmouseselected"; // class of the row
Selectedrowid = parseint (rowindex, 10) + 1;
}
3. keyboard listening events
Required parameter Doc ument. onkeydown = inpcodetoform2;
Flagf01 = true;
Flagf02 = true;
// When necessary, you cannot perform manual operations.
Function inpcodetoform (){
If (parent.kaiten_center.doc ument. getelementbyid ("kyousei ")){
// Enter the internal management site
If (flagf02 ){
If (event. keycode = "115 "){
Killevent ();
Parent.kaiten_center.doc ument. getelementbyid ('inputjan '). Focus ();
}
} Else {
If (event. keycode = "115 "){
Killevent ();
}
}
} Else {
// Merged rows in the pay-as-you-go table
If (flagf01 ){
If (event. keycode = "115 "){
Killevent ();
Parent.kaiten_left.doc ument. getelementbyid ('inputjan '). Focus ();
}
} Else {
If (event. keycode = "115 "){
Killevent ();
}
}
}
}