Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
7a2754e2
...
7a2754e249de6982622a18bd34ea13961d53e649
authored
2012-05-22 10:17:36 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed #117 - fill() cant submit a form with a submit input named "submit"
1 parent
fd9956c5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
modules/casper.js
tests/site/form.html
modules/casper.js
View file @
7a2754e
...
...
@@ -531,7 +531,12 @@ Casper.prototype.fill = function fill(selector, vals, submit) {
var
method
=
(
form
.
getAttribute
(
'method'
)
||
"GET"
).
toUpperCase
();
var
action
=
form
.
getAttribute
(
'action'
)
||
"unknown"
;
__utils__
.
log
(
'submitting form to '
+
action
+
', HTTP '
+
method
,
'info'
);
form
.
submit
();
if
(
typeof
form
.
submit
===
"function"
)
{
form
.
submit
();
}
else
{
// http://www.spiration.co.uk/post/1232/Submit-is-not-a-function
form
.
submit
.
click
();
}
},
{
selector
:
selector
});
}
};
...
...
tests/site/form.html
View file @
7a2754e
...
...
@@ -19,7 +19,7 @@
<input
type=
"checkbox"
name=
"checklist[]"
value=
"1"
/>
<input
type=
"checkbox"
name=
"checklist[]"
value=
"2"
/>
<input
type=
"checkbox"
name=
"checklist[]"
value=
"3"
/>
<input
type=
"submit"
/>
<input
type=
"submit"
name=
"submit"
value=
"submit"
/>
</form>
</body>
</html>
\ No newline at end of file
</html>
...
...
Please
register
or
sign in
to post a comment