Insert code in multiple lines

Source: Internet
Author: User

<Script language = "JavaScript">
// Enter the script content
Function max ()
{
VaR STR = (document. Send. VII. Value). Length
Alert ('length of the input value is '+ STR +' bit ');
}

Function changevalue ()
{
If (document. All. VII. value = ''& document. All. Vie. value! = '')
{
Document. All. VII. value = Document. All. Vie. value;
Document. All. Vie. value = '';
}
Else if (document. All. Vie. value = ''& document. All. VII. value! = '')
{
Document. All. Vie. value = Document. All. VII. value;
Document. All. VII. value = '';
}
Else if (document. All. Vie. value! = ''& Document. All. VII. value! = '')
{
VaR x = Document. All. Vie. Value
Var y = Document. All. VII. Value
Document. All. Vie. value = y;
Document. All. VII. value = X;
}
}

</SCRIPT>
<Form name = "send">
<Input type = text value = ''name =" VII ">
<Input type = text value = ''name =" Vie ">
<Input type = "button" value = "change" class = "buttonsave" onclick = "javascript: changevalue ();" id = button2 name = button2>
<Input type = "button" value = "test" class = "buttonsave" onclick = "javascript: max ();" id = button2 name = button2>

</Form>

</BR>
<Script language = "JavaScript">

<! -- // Insert any record at a time
// Add a single entry
Function setid (){
VaR d = (document. All. N. value)
STR = '';

D = ++ (d)
If (D> 10)
{
Alert ('You really want to insert '+ D +' rows at a time! \ N, but the system can only charge up to 10 rows .')

Return false;

}

For (I = 1; I <= D; I ++)

STR + = ''+ I + '. registration Name: <input type = text name = "name"> password: <input type = password name = "pass"> <br> ';
Window. tbid. innerhtml = STR + '<br> ';
If (d <= 10)
{
Document. All. N. value = D;
}
Else
{Document. All. N. value = 10}
Document. All. upcount. value = 1;
Document. All. scount. value = '';

// Alert (STR + '\ NN value:' + document. All. N. value );
}

// Batch increase
Function batsetid ()

{
STR =''
VaR d = Document. All. upcount. Value
If (D> 10)
{
Alert ('You really want to insert '+ D +' rows at a time! \ N, but the system can only charge up to 10 rows .')
Return false;

}
For (I = 1; I <= D; I ++)

STR + = ''+ I + '. registration Name: <input type = text name = "name"> password: <input type = password name = "pass"> <br> ';
Window. tbid. innerhtml = STR + '<br> ';
Document. All. N. value = D;
Document. All. upcount. value = 1;
Document. All. scount. value = '';
// Alert (STR + '\ NN value:' + document. All. N. value );
}
// Delete a single entry
Function delline ()
{
VaR d = Document. All. N. Value
STR = '';
D = -- (d)
If (D = 0)
{
Alert ('You really don't want any more? ');
// Alert (d)
Document. All. scount. value = '';
Return false;
}
Else if (d <0)
{
VaR x = Document. All. scount. value;
Var y = Document. All. scount. Value-document. All. N. value;

Alert ('number of items to be deleted '+ x +' more than the number of existing items '+ Y + ');
// Alert (d );
Document. All. scount. value = '';
Return false;
}
For (I = 1; I <= D; I ++)

STR + = ''+ I + '. registration Name: <input type = text name = "name"> password: <input type = password name = "pass"> <br> ';
Window. tbid. innerhtml = STR + '<br> ';
Document. All. N. value = D;
Document. All. scount. value = '';
}
// Batch Delete
Function batdel ()

{
If (document. All. scount. value = '')
{
Alert ('Enter the number of items to delete! ')
Document. All. scount. Focus ();
Return false;
}
STR =''
VaR d = Document. All. N. Value
D = D-document. All. scount. Value
If (D = 0)
{
Alert ('You really don't want any more? ');
// Alert (d)
Document. All. scount. value = '';
Return false;
}
Else if (d <0)
{
VaR x = Document. All. scount. value;
Var y = Document. All. scount. Value-document. All. N. value;

Alert ('number of items to be deleted '+ x +' more than the number of existing items '+ Y + ');
// Alert (d );
Document. All. scount. value = '';
Return false;
}
For (I = 1; I <= D; I ++)

STR + = ''+ I + '. registration Name: <input type = text name = "name"> password: <input type = password name = "pass"> <br> ';
Window. tbid. innerhtml = STR + '<br> ';
Document. All. Pass. Focus ();
Document. All. N. value = D;
Document. All. upcount. value = 1;
Document. All. scount. value = '';
// Alert (STR + '\ NN value:' + document. All. N. value );
}

// -->
</SCRIPT>

<Script for = "document" event = "onkeydown" Language = "JavaScript">
// Keyboard operation definition, allowing one carriage return to the end.
If (event. keycode = 13 ){
Event. keycode = 9;

}
If (event. keycode = 187)
{
Setid ();
}
If (event. keycode = 189)
{
Delline ();
}
If (event. ctrlkey)
{
If (event. keycode = 46)
{
Document. All. scount. value = Document. All. N. Value-1

If (confirm ('Are you sure you want to delete it? '))
{Batdel ();}
}
If (event. keycode = 45)
{
Document. All. upcount. value = 10
Batsetid ();
}
}

</SCRIPT>
<Body onload = "document. All. Pass. Focus ();">
<Form name = "myform">
<Select name = "upcount" class = "txtfld4" onchange = "batsetid ()">

<Option value = "1"> 1 </option>

<Option value = "2"> 2 </option>

<Option value = "3"> 3 </option>

<Option value = "4"> 4 </option>

<Option value = "5"> 5 </option>

<Option value = "6"> 6 </option>

<Option value = "7"> 7 </option>

<Option value = "8"> 8 </option>

<Option value = "9"> 9 </option>

<Option value = "10"> 10 </option>

</SELECT>

Reduced quantity <input type = "text" name = "scount" value = "" size = "3" maxlength = "2"> <input type = "button" value = "batchdel -"class =" buttonsave "onclick =" javascript: batdel (); "id = button2 name = button2> <input type =" button "value =" add + "class =" buttonsave "onclick =" javascript: setid (); "id = button2 name = button2> <input type =" button "value =" Del-"class =" buttonsave "onclick =" javascript: delline (); "id = button2 name = button2>
<Table>
<Tr>
<TD id = "tbid" colspan = "3" nowrap> User Name <input type = text name = "name">
Password <input type = password name = "pass">

<Br> </TD>
</Tr>
</Table>
Current quantity: <input type = "text" name = "N" value = "1">

</Form>
+ Add row-number to reduce row Ctrl + DEL Delete All Ctrl + INS add to maximum
</Body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.