MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / reset

Method reset

src/main/java/org/htmlunit/html/HtmlForm.java:422–436  ·  view source on GitHub ↗

Resets this form to its initial values, returning the page contained by this form's window after the reset. Note that the returned page may or may not be the same as the original page, based on JavaScript event handlers, etc. @return the page contained by this form's window after the reset

()

Source from the content-addressed store, hash-verified

420 * @return the page contained by this form's window after the reset
421 */
422 public Page reset() {
423 final SgmlPage sgmlPage = getPage();
424 final ScriptResult scriptResult = fireEvent(Event.TYPE_RESET);
425 if (ScriptResult.isFalse(scriptResult)) {
426 return sgmlPage.getWebClient().getCurrentWindow().getEnclosedPage();
427 }
428
429 for (final HtmlElement next : getHtmlElementDescendants()) {
430 if (next instanceof SubmittableElement element) {
431 element.reset();
432 }
433 }
434
435 return sgmlPage;
436 }
437
438 /**
439 * {@inheritDoc}

Callers 2

doClickStateUpdateMethod · 0.95
doClickStateUpdateMethod · 0.95

Calls 8

isFalseMethod · 0.95
getWebClientMethod · 0.95
getCurrentWindowMethod · 0.80
getPageMethod · 0.65
getEnclosedPageMethod · 0.65
resetMethod · 0.65
fireEventMethod · 0.45

Tested by

no test coverage detected