You need to modify the action attribute of form in JS, but there is a control in form that is also called action. My Processing Method

Source: Internet
Author: User

It is best not to use the default property name
However, if a program is used, no errors will occur,
Only unexpected things will appear.

For example:
<Form action = "test12.asp" method = "get" onsubmit = "_ submit ()" name = 'frm'>

<INPUT type = "text" id = text1 name = action>
<INPUT type = "submit" value = "Submit" id = submit1 name = submit1>
</Form>

<Script>
Function _ submit (){
Frm. action. value = "ddddddddd"
}
</Script>
======================
It will be the value of the input name action, rather than the form action attribute value.
====================
In this case, if you still want to use it, you can use attributes
That is:
FRM. attributes [83]. value = "test2.asp"
For how to get 83, you can get it using the following program:
For (I = 0; I <frm. Attributes. length; I ++ ){
Document. Write (FRM. attributes [I]. Name + "------- index:" + I + "<br> ");
}

 

Language ------- index: 0
Dataworks ------- index: 1
Onmouseup ------- index: 2
Class ------- index: 3
Oncontextmenu ------- index: 4
Onrowexit ------- index: 5
Onbeforepaste ------- index: 6
Onactivate ------- index: 7
Lang ------- index: 8
Onmousemove ------- index: 9
Onmove ------- index: 10
Onselectstart ------- index: 11
Oncontrolselect ------- index: 12
Onkeypress ------- index: 13
Oncut ------- index: 14
Onrowenter ------- index: 15
Onmousedown ------- index: 16
Onpaste ------- index: 17
Id ------- index: 18
Onreadystatechange ------- index: 19
Onbeforedeactivate ------- index: 20
Hidefocus ------- index: 21
Dir ------- index: 22
Onkeydown ------- index: 23
Onlosecapture ------- Index: 24
Ondrag ------- Index: 25
Ondragstart ------- Index: 26
Oncellchange ------- Index: 27
Onfilterchange ------- Index: 28
Onrowsinserted ------- Index: 29
Ondatasetcomplete ------- Index: 30
Onmousewheel ------- Index: 31
Ondragenter ------- Index: 32
Onblur ------- Index: 33
Onresizeend ------- Index: 34
Onerrorupdate ------- Index: 35
Onbeforecopy ------- Index: 36
Ondblclick ------- Index: 37
Onkeyup ------- Index: 38
Onresizestart ------- Index: 39
Onmouseover ------- Index: 40
Onmouseleave ------- index: 41
Onmoveend ------- index: 42
Title ------- index: 43
Onresize ------- index: 44
Contenteditable ------- index: 45
Dataformatas ------- index: 46
Ondrop ------- index: 47
Onpage ------- index: 48
Onrowsdelete ------- index: 49
Style ------- index: 50
Onfocusout ------- index: 51
Ondatasetchanged ------- index: 52
Ondeactivate ------- index: 53
Onpropertychange ------- index: 54
Ondragover ------- index: 55
Onhelp ------- index: 56
Ondragend ------- index: 57
Onbeforeeditfocus ------- Index: 58
Disabled ------- Index: 59
Onfocus ------- Index: 60
AccessKey ------- Index: 61
Onscroll ------- Index: 62
Onbeforeactivate ------- Index: 63
Onbeforecut ------- Index: 64
DataSrc ------- Index: 65
Onclick ------- Index: 66
Oncopy ------- Index: 67
Onfocusin ------- Index: 68
TabIndex ------- Index: 69
Onbeforeupdate ------- Index: 70
Ondataavailable ------- Index: 71
Onmovestart ------- Index: 72
Onmouseout ------- Index: 73
Onmouseenter ------- Index: 74
Onlayoutcomplete ------- index: 75
Implementation ------- index: 76
Onafterupdate ------- index: 77
Ondragleave ------- index: 78
Name ------- index: 79
Onreset ------- index: 80
Accept-charset ------- index: 81
Onsubmit ------- index: 82
Action ------- index: 83
Method ------- index: 84
Target ------- index: 85
Enctype ------- index: 86

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.