HI,
I have looked at the code of how HTMLFormElement builds query string when it
is submitted.
For each form control element it needs to build a query string of a key and
value pair.
I think the code which does it is (which i confirmed by stepped thru the
debugger):
My question is in the for loop before, why it only cares about Input Form
Element when building the form data? What happens to Select form element's
value?
void HTMLFormElement::submit(Event* event, bool activateSubmitButton, bool
lockHistory, FormSubmissionTrigger formSubmissionTrigger)
{
//... omit
Vector<pair<String, String> > formValues;
for (unsigned i = 0; i < formElements.size(); ++i) {
HTMLFormControlElement* control = formElements[i];
// Question: Why it only checks for input form element???
if (control->hasLocalName(inputTag)) {
HTMLInputElement* input =
static_cast<HTMLInputElement*>(control);
if (input->isTextField()) {
formValues.append(pair<String, String>(input->name(),
input->value()));
if (input->isSearchField())
input->addSearchResult();
}
}
if (needButtonActivation) {
if (control->isActivatedSubmit())
needButtonActivation = false;
else if (firstSuccessfulSubmitButton == 0 &&
control->isSuccessfulSubmitButton())
firstSuccessfulSubmitButton = control;
}
}
//... omit
}
_______________________________________________
webkit-help mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-help