Validate the response while saving a new address
This commit is contained in:
parent
3f0a229f17
commit
afe701ae59
1 changed files with 5 additions and 0 deletions
|
|
@ -300,6 +300,11 @@
|
|||
var id = o.responseText,
|
||||
d = self.elements.dropdowns;
|
||||
|
||||
if (!id.match(/^[A-Za-z0-9_-]{22}$/)) {
|
||||
alert('Error: bad response trying to save address.');
|
||||
return;
|
||||
}
|
||||
|
||||
function updateOne(dropdown) {
|
||||
var opt = _.detect(dropdown.options, function (o) {
|
||||
return o.text === label;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue