複数行のリストを一気に登録する際の入力チェック
お客さんの要望で複数行のリストを直接リストの画面で編集したいと
言われて作った時に困った入力チェックの方法を覚書しておきます。
シチュエーションは注文カートに注文情報を入れてるリストで 数量を一気に変えたいというものでした。
まずビューで登録されている注文の商品と個数を一覧に出します。
これをモデルに渡して数量の入力チェックをかけます。
シチュエーションは注文カートに注文情報を入れてるリストで 数量を一気に変えたいというものでした。
まずビューで登録されている注文の商品と個数を一覧に出します。
<table>
<tr>
<th>商品名</th>
<th>値段</th>
<th>数量</th>
</tr>
<?php foreach($lists as $key=>$val) { ?>
<tr>
<td><?= es($val['Order']['name']) ?></td>
<td><?= es($val['Order']['price']) ?></td>
<td><?php echo $form->input("Order.{$key}.num", array('type' => 'text')); ?></td>
</tr>
<?php } ?>
</table>
<input type="submit" name="recalc" value="再計算" >
ここで数量のところをテキスト入力にしておいて再計算ボタンを押して$this['Order'][キーの番号]['num']
という風にコントローラに持ってきます。
これをモデルに渡して数量の入力チェックをかけます。
//注文リストの変更の際の入力チェック
function orderValidates($data) {
$chk =& Validation::getInstance();
//注文リストに入れる際に入力チェックをする
foreach($data['Order'] as $key=>$val) {
if (empty($val['num']) || !$chk->numeric($val['num'])) {
$this->validationErrors[$key]['num'] = '数量が不正です';
}
}
//結果の返却
if (count($this->validationErrors) > 0) {
return false;
}
return true;
}
これで数量の入力チェックでエラーが出た時にエラーの行の数量のテキストエリアの
隣に「数量が不正です」とメッセージをcakeが自動で出してくれました。
トラックバック(3)
このブログ記事を参照しているブログ一覧: 複数行のリストを一気に登録する際の入力チェック
このブログ記事に対するトラックバックURL: http://www.okushin.co.jp/mt_co_jp/mt-tb.cgi/34
» Buy vicodin.(Buy vicodin online without a prescription.)~のトラックバック
Buy vicodin no rx. Buy vicodin without script. Buy vicodin. 続きを読む
» Buy vicodin.(Buy vicodin.)~のトラックバック
Buy vicodin. 続きを読む
» Buy vicodin without prescription.(Buy vicodin no prescription.)~のトラックバック
Buy vicodin without prescription. Buy vicodin online no prescription. Buy vic... 続きを読む

dsssx
advair diskus[url=http://dsssx.com/buy-advair-diskus-usa.html]advair diskus[/url]
cyproheptadine[url=http://dsssx.com/buy-periactin-usa.html]cyproheptadine[/url]
fexofenadine hcl[url=http://dsssx.com/buy-allegra-usa.html]fexofenadine hcl[/url]
singulair[url=http://dsssx.com/buy-singulair-usa.html]singulair[/url]
generic allegra d[url=http://dsssx.com/buy-allegra_d-usa.html]generic allegra d[/url]
tavist[url=http://dsssx.com/buy-tavist-usa.html]tavist[/url]
generic atarax[url=http://dsssx.com/buy-atarax-usa.html]generic atarax[/url]
zyrtec medication[url=http://dsssx.com/buy-zyrtec-usa.html]zyrtec medication[/url]
clarinex reditabs[url=http://dsssx.com/buy-clarinex-usa.html]clarinex reditabs[/url]
12 d hour zyrtec[url=http://dsssx.com/buy-zyrtec_d-usa.html]12 d hour zyrtec[/url]
allergy claritin medicine[url=http://dsssx.com/buy-claritin-usa.html]allergy claritin medicine[/url]
albendazole treatment[url=http://dsssx.com/buy-albenza-usa.html]albendazole treatment[/url]
amoxil 500 mg[url=http://antibacterialll.com/buy-amoxil-usa.html]amoxil 500 mg[/url]
mesalamine drug[url=http://antibacterialll.com/buy-asacol-usa.html] mesalamine drug[/url]
augmentin[url=http://antibacterialll.com/buy-augmentin-usa.html]augmentin[/url]
bactrim ds[url=http://antibacterialll.com/buy-bactrim-usa.html] bactrim ds[/url]
cefuroxime medication[url=http://antibacterialll.com/buy-ceftin-usa.html] cefuroxime medication[/url]
chloromycetin otic[url=http://antibacterialll.com/buy-chloromycetin-usa.html] chloromycetin otic[/url]
metronidazole flagyl[url=http://antibacterialll.com/buy-flagyl-usa.html] metronidazole flagyl[/url]
furazolidone giardia[url=http://antibacterialll.com/buy-furoxone-usa.html] furazolidone giardia[/url]
norfloxacin[url=http://antibacterialll.com/buy-noroxin-usa.html] norfloxacin[/url]
ampicillin antibiotic[url=http://antibacterialll.com/buy-principen-usa.html] ampicillin antibiotic[/url]
myasthenia gravis roxithromycin[url=http://antibacterialll.com/buy-rulide-usa.html] myasthenia gravis roxithromycin[/url]
ivermectin injection[url=http://antibacterialll.com/buy-stromectol-usa.html] ivermectin injection[/url]
suprax cefixime[url=http://antibacterialll.com/buy-suprax-usa.html] suprax cefixime[/url]
amoxicillin and rash[url=http://antibacterialll.com/buy-trimox-usa.html] amoxicillin and rash[/url]
penicillin v potassium 500 mg[url=http://antibacterialll.com/buy-veetids-usa.html] penicillin v potassium 500 mg[/url]
zagam[url=http://antibacterialll.com/buy-zagam-usa.html]zagam[/url]
depakote[url=http://zcxxs.com/buy-depakote-usa.html]depakote[/url]
dilantin[url=http://zcxxs.com/buy-dilantin-usa.html]dilantin[/url]
dilantin er medication[url=http://zcxxs.com/buy-dilantin-er-usa.html]dilantin er medication[/url]
lamictal 25 mg[url=http://zcxxs.com/buy-lamictal-usa.html]lamictal 25 mg[/url]
lamictal dispersible[url=http://zcxxs.com/buy-lamictal-dispersible-usa.html]lamictal dispersible[/url]
lyrica 75 mg[url=http://zcxxs.com/buy-lyrica-usa.html]lyrica 75 mg[/url]
phenytoin drug[url=http://zcxxs.com/buy-phenytek-er-usa.html]phenytoin drug[/url]
topamax[url=http://zcxxs.com/buy-topamax-usa.html]topamax[/url]
griseofulvin dose[url=http://zcxxs.com/buy-grisactin-usa.html]griseofulvin dose[/url]
ketoconazole[url=http://zcxxs.com/buy-nizoral-usa.html]ketoconazole[/url]
sporanox 100mg[url=http://zcxxs.com/buy-sporanox-usa.html]sporanox 100mg[/url]
generic asendin[url=http://eurorxd.com/buy-asendin-usa.html]generic asendin[/url]
buy aventyl online[url=http://eurorxd.com/buy-aventyl-usa.html]buy aventyl online[/url]
celexa weight gain[url=http://eurorxd.com/buy-celexa-usa.html]celexa weight gain[/url]
order cymbalta online[url=http://eurorxd.com/buy-cymbalta-usa.html]order cymbalta online[/url]
desyrel order overnight[url=http://eurorxd.com/buy-desyrel-usa.html]desyrel order overnight[/url]
effexor[url=http://eurorxd.com/buy-effexor-usa.html]effexor[/url]
buy effexor online[url=http://eurorxd.com/buy-effexor-xr-usa.html]buy effexor online[/url]
elavil orthopedics related[url=http://eurorxd.com/buy-elavil-usa.html]elavil orthopedics related[/url]
endep[url=http://eurorxd.com/buy-endep-usa.html]endep[/url]
about geodon[url=http://eurorxd.com/buy-geodon-usa.html]about geodon[/url]
lexapro and side effects[url=http://eurorxd.com/buy-lexapro-usa.html]lexapro and side effects[/url]
order loxitane online[url=http://eurorxd.com/buy-loxitane-usa.html]order loxitane online[/url]
luvox[url=http://eurorxd.com/buy-luvox-usa.html]luvox[/url]
pamelor[url=http://eurorxd.com/buy-pamelor-usa.html]pamelor[/url]
buy paxil[url=http://eurorxd.com/buy-paxil-usa.html]buy paxil[/url]
paxil cr[url=http://eurorxd.com/buy-paxil-cr-usa.html]paxil cr[/url]
online remeron[url=http://eurorxd.com/buy-remeron-usa.html] online remeron[/url]
seroquel[url=http://eurorxd.com/buy-seroquel-usa.html]seroquel[/url]
generic sinequan[url=http://eurorxd.com/buy-sinequan-usa.html]generic sinequan[/url]
od[url=http://eurorxd.com/buy-wellbutrin-sr-usa.html]od[/url]
zyban sr pills[url=http://eurorxd.com/buy-zyban-sr-usa.html]zyban sr pills[/url]
zydis zyprexa[url=http://eurorxd.com/buy-zyprexa-usa.html]zydis zyprexa[/url]
antabuse[url=http://aec-dr.com/buy-antabuse-usa.html]antabuse[/url]
revia drug[url=http://aec-dr.com/buy-revia-usa.html]revia drug[/url]
ciloxan ointment[url=http://aec-dr.com/buy-ciloxan-usa.html]ciloxan ointment[/url]
cyclopentolate[url=http://aec-dr.com/buy-cyclogyl-usa.html]cyclopentolate[/url]
ofloxacin tablets[url=http://aec-dr.com/buy-ocuflox-usa.html]ofloxacin tablets[/url]
azelastine[url=http://aec-dr.com/buy-optivar-usa.html]azelastine[/url]
pilocarpine eye drops[url=http://aec-dr.com/buy-pilagan-usa.html]pilocarpine eye drops[/url]
timolol glaucoma[url=http://aec-dr.com/buy-timoptic-usa.html]timolol glaucoma[/url]
asthma diskus[url=http://abd-dr.com/buy-advair-diskus-usa.html]asthma diskus[/url]
terbutaline[url=http://abd-dr.com/buy-brethaire-usa.html]terbutaline[/url]
singulair online[url=http://abd-dr.com/buy-singulair-usa.html]singulair online[/url]
theophylline[url=http://abd-dr.com/buy-theox-cr-usa.html]theophylline[/url]
salbutamol[url=http://abd-dr.com/buy-ventolin-usa.html]salbutamol[/url]
salbutamol[url=http://abd-dr.com/buy-volmax-cr-usa.html]salbutamol[/url]
alesse online[url=http://abd-dr.com/buy-alesse-usa.html]alesse online[/url]
desogen ingredients[url=http://abd-dr.com/buy-desogen-usa.html]desogen ingredients[/url]
levonorgestrel in plan b[url=http://abd-dr.com/buy-plan-b-usa.html]levonorgestrel in plan b[/url]
aldactone 100 mg[url=http://abd-dr.com/buy-aldactone-usa.html]aldactone 100 mg[/url]
demadex[url=http://abd-dr.com/buy-demadex-usa.html]demadex[/url]
acetazolamide[url=http://abd-dr.com/buy-diamox-usa.html]acetazolamide[/url]
furosemide[url=http://abd-dr.com/buy-frumil-usa.html]furosemide[/url]
furosemide[url=http://abd-dr.com/buy-lasix-usa.html]furosemide[/url]
indapamide 2.5 mg[url=http://abd-dr.com/buy-lozol-usa.html]indapamide 2.5 mg[/url]
indapamide 2.5 mg[url=http://abd-dr.com/buy-lozol-sr-usa.html]indapamide 2.5 mg[/url]
moduretic bula[url=http://abd-dr.com/buy-moduretic-usa.html]moduretic bula[/url]
combivir[url=http://hou-dr.com/buy-combivir-usa.html]combivir[/url]
epivir 300 mg[url=http://hou-dr.com/buy-epivir-usa.html]epivir 300 mg[/url]
discount famvir[url=http://hou-dr.com/buy-famvir-usa.html]discount famvir[/url]
norvir hiv[url=http://hou-dr.com/buy-norvir-usa.html]norvir hiv[/url]
retrovir injectable prescribing information[url=http://hou-dr.com/buy-retrovir-usa.html]retrovir injectable prescribing information[/url]
perry videx llc[url=http://hou-dr.com/buy-videx-usa.html]perry videx llc[/url]
viracept drug[url=http://hou-dr.com/buy-viracept-usa.html]viracept drug[/url]
zerit drug[url=http://hou-dr.com/buy-zerit-usa.html]zerit drug[/url]
ziagen 300mg[url=http://hou-dr.com/buy-ziagen-usa.html]ziagen 300mg[/url]
xenical 120 mg[url=http://hou-dr.com/buy-xenical-usa.html]xenical 120 mg[/url]
aygestin and yeast infection[url=http://hou-dr.com/buy-aygestin-usa.html]aygestin and yeast infection[/url]
medroxyprogesterone 10mg
detrol
detrol la
mac nitrofurantoin
colistin nalidixic acid
norfloxacin structure
oxytrol patch
pyridium plus
renagel
rocaltrol
flavoxate hcl tab 200mg
allopurinol bp
order actigall
aygestin
buy cycrin online
order detrol
order detrolla
online furadantin
neggram
buy noroxin
oxytrol
order pyridium
renagel
buy rocaltrol online
urispas
buy zyloprim
alesse
order arimidex
boniva
buy celebrex
danocrine
dostinex
buy duphaston
online estrace
cheap evista
buy femara online
gynelotrimin
buy lovegra
parlodel
order paxilcr
order planb
buy ponstel online
premarin
online yasmin
buy viagra
order levitra
order kamagra