func NewForm(querier Querier, event js.Value) (*Form, error) {
	if querier == nil {
		return nil, errors.New("no querier specified")
	}
	form := event.Get("target")
	method := form.Get("method").String()
	action := form.Get("action").String()
	u, err := url.Parse(action)
	if err != nil {
		return nil, errors.New("getting url from form action: " + err.Error())
	}
	f := Form{
		Element: form,
		Method:  method,
		URL:     *u,
		querier: querier,
	}
	formInputs := f.NonSubmitInputs()
	f.Params = make(url.Values, len(formInputs))
	for _, formInput := range formInputs {
		name := formInput.Get("name").String()
		value := formInput.Get("value").String()
		f.Params.Add(name, value)
	}
	return &f, nil
}
// NewForm creates a form from the target property of the event.  An error is returned if the url action is not successfully parsed.
NewForm creates a form from the target property of the event.  An error is returned if the url action is not successfully parsed.
// NewForm creates a form from the target property of the event . An error is returned if the url action is not successfully parsed .
func NewForm(querier Querier, event js.Value) (*Form, error) {
	if querier == nil {
		return nil, errors.New("no querier specified")
	}
	form := event.Get("target")
	method := form.Get("method").String()
	action := form.Get("action").String()
	u, err := url.Parse(action)
	if err != nil {
		return nil, errors.New("getting url from form action: " + err.Error())
	}
	f := Form{
		Element: form,
		Method:  method,
		URL:     *u,
		querier: querier,
	}
	formInputs := f.NonSubmitInputs()
	f.Params = make(url.Values, len(formInputs))
	for _, formInput := range formInputs {
		name := formInput.Get("name").String()
		value := formInput.Get("value").String()
		f.Params.Add(name, value)
	}
	return &f, nil
}
func NewForm ( querier Querier , event js . Value ) ( * Form , error ) { if querier == nil { return nil , errors . New ( " " ) } form := event . Get ( " " ) method := form . Get ( " " ) . String ( ) action := form . Get ( " " ) . String ( ) u , err := url . Parse ( action ) if err != nil { return nil , errors . New ( " " + err . Error ( ) ) } f := Form { Element : form , Method : method , URL : * u , querier : querier , } formInputs := f . NonSubmitInputs ( ) f . Params = make ( url . Values , len ( formInputs ) ) for _ , formInput := range formInputs { name := formInput . Get ( " " ) . String ( ) value := formInput . Get ( " " ) . String ( ) f . Params . Add ( name , value ) } return & f , nil }
NewForm creates a form from the target property of the event.
NewForm creates a form from the target property of the event .