Wrong redirect #3276

Closed
danijelGombac opened this Issue Aug 27, 2015 · 6 comments

Projects

None yet

3 participants

@danijelGombac
Contributor

On shipping estimate and review form, when press enter and input field is focused redirected on home page. Maybe also on some other forms . I didn't checked.

@danielkerr
Contributor

there is no redirect on the review form.

@danijelGombac
Contributor

On Firefox and Chrome I try and when click on name field and press enter redirect me on home with form values in url.

@hotwer
hotwer commented Aug 27, 2015

Yes, there is a bug on checkout/cart route.
The $shipping variable is populated with the index of total/shipping controller.
Since the shipping is a formulary...

<form class="form-horizontal">
    // zone code...
    <div class="form-group required">
      <label class="col-sm-2 control-label" for="input-postcode"><?php echo $entry_postcode; ?></label>
      <div class="col-sm-10">
        <input type="text" name="postcode" value="<?php echo $postcode; ?>" placeholder="<?php echo $entry_postcode; ?>" id="input-postcode" class="form-control" />
      </div>
    </div>
    <input type="button" value="<?php echo $button_quote; ?>" id="button-quote" data-loading-text="<?php echo $text_loading; ?>" class="btn btn-primary" />
</form>

... The default way the browser handles the enter (since there's button in the formulary), on formularies, it's to submit with default settings (it performs a GET call with and empty action) and probably review have the same issue.

The problem is, the button is supposed to be performing an ajax call.

Either the way is to handle the enter press on any fields, to perform the button click, os just prevent the default submit action.

To be honest, I think it's better to turn the enter action to behave as clicking the button, but's that's just my opinion.

@danielkerr
Contributor

it wont submit the form if the button is set to type button.

@danielkerr
Contributor

it does it on shipping

@danijelGombac
Contributor

This is url after click on name field and press enter in review form:

http://localhost/gombac_2/index.php?name=&text=

@danielkerr danielkerr closed this Aug 28, 2015
@danielkerr danielkerr added a commit that referenced this issue Aug 28, 2015
@danielkerr danielkerr #3276 c8cf083
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment