deejagothic 1 Report post Posted April 15, 2010 Salam, Aku ade buat satu form. Dalam form tu ade byk input element. Dalam form tu ade button save dgn submit. Dalam masa yg sama, ada satu link utk ke page lain. Bila user masukkan data kedalam input element, dan tekan save, data akan disave. Tapi masalahnye bila dia masukkan data, tapi sblom tekan save, dia klik kat link, data yg dia key in tu tak save. Jadi solusinya, aku buat onClick listener kat link tu. Dgn harapan yg murni, bile click link, dia akan trigger button save. Simple je function trigger tu... doc.getelementbyid.click()! dan pada kali pertama...ia berjaya.. tapi kengkadang dia fail. (selalu jgak la fail) unless aku load page tu tanpa cache. utk kali pertama je berjaya...bile kali kedua, tak berjaya.. Ape yg tak kene eh? Sila beri pendapat...workaround pun buleh...aku perlukan idea!!!!! Quote Share this post Link to post Share on other sites
dans kam 39 Report post Posted April 15, 2010 (edited) try guna submit().. [code]<a href="...." onClick="document.form1.submit();">[/code] [quote]Dalam form tu ade button save dgn submit[/quote] ape beza button save dgn button submit? dari segi fungsinye kat form yg ko buat.. Edited April 15, 2010 by dans kam Quote Share this post Link to post Share on other sites
slier 28 Report post Posted April 15, 2010 (edited) ko hide kan je link tu bila user cuba utk save lepas habis save..show kan balik link tu simple je p/s:aku rasa dia save pki ajax tu...klu pki submit..xde nye user nak click link Edited April 15, 2010 by slier Quote Share this post Link to post Share on other sites
deejagothic 1 Report post Posted April 15, 2010 Camnih.. Save utk save form...submit..utk submit form tu. Save maknanye user boleh edit lagi form tu...submit, user takleh edit dahh.. Link tu plak, utk user isi sub-form. Camtu lah lebih kurang.. Takleh hide link..requirement kene ade link.. form.submit() tu cam menarik jgak.. tunggu aku buat poc dlu..nanti ku btau result! Terimas sarkas!! Quote Share this post Link to post Share on other sites