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
436eabb1
...
436eabb119e70007a7ab8cd79f103a9cd51c13f6
authored
2011-10-09 19:01:12 +0200
by
Nicolas Perriault
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixed unrocognized textarea tag for form filling
1 parent
0e21d42f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
casper.js
casper.js
View file @
436eabb
...
...
@@ -604,7 +604,7 @@
* @param Object vals Field values
*/
this
.
fill
=
function
(
form
,
vals
,
submit
)
{
submit
=
typeof
(
submit
)
!==
"undefined"
||
false
;
submit
=
submit
||
false
;
if
(
!
(
form
instanceof
HTMLElement
)
||
typeof
(
form
)
===
"string"
)
{
form
=
document
.
querySelector
(
form
);
}
...
...
@@ -670,13 +670,13 @@
console
.
log
(
'set "'
+
field
.
getAttribute
(
'name'
)
+
'" value to '
+
value
);
}
value
=
value
||
""
;
switch
(
field
.
nodeName
.
toLowerCase
())
{
var
nodeName
=
field
.
nodeName
.
toLowerCase
();
switch
(
nodeName
)
{
case
"input"
:
var
type
=
field
.
getAttribute
(
'type'
)
||
"text"
;
switch
(
type
.
toLowerCase
())
{
case
"password"
:
case
"text"
:
case
"textarea"
:
field
.
value
=
value
;
break
;
case
"checkbox"
:
...
...
@@ -696,8 +696,11 @@
case
"select"
:
console
.
log
(
'select tag fillin not implemented'
);
break
;
case
"textarea"
:
field
.
value
=
value
;
break
;
default
:
console
.
log
(
'unsupported field type: '
+
typ
e
);
console
.
log
(
'unsupported field type: '
+
nodeNam
e
);
break
;
}
}
...
...
Please
register
or
sign in
to post a comment