bajetzashu89 Posted February 19, 2013 Report Posted February 19, 2013 salut !Am o problema cu un script java sau cel putin asa cred...Problema este ca nu pot sa ma folosesc de acelasi script pentru un force select la mai multe listbox.Scriptul merge decat la un singur produs !Am scriptul asta :<script type="text/javascript">function reqSel(){var result = "1";var txt = "Please select size !"; var warn = new Array();warn[0] = "*";var F = document.forms["page1"];if(F.elements["product[select Size]"].options[F.elements["product[select Size]"].options.selectedIndex].value == '') {result += warn[0];}if(result.length > 0){alert(txt + result + "\n__________________\n\nThank you!"); return false;}else{return true;}}</script>iar in pagina mea asta :<form action="http://ww8.aitsafe.com/cf/add.cfm" method="post" name="page1" onsubmit="return reqSel()"><input type="hidden" name="userid" value="993277092"><input type="hidden" name="product[]" value="Denumire produs"><input type="hidden" name="price" value="47.5"><input type="hidden" name="return" value="www.website.com"><br><select class="rounded" name="product[select Size]"><option value="">Select Size</option> <option value="36">36</option> <option value="40">40</option> </select> <br> <input class="rounded" type="image" src="images/content/1.png"/> </form>Cum as putea sa fac ca scriptul asta sa mearga cu inca 100 de produse diferite ,sau daca are cineva vre-o idee de alta modalitate e a forta cumparatorul sa aleaga ceva din lista de produse!Multumesc ! Quote
bajetzashu89 Posted February 20, 2013 Author Report Posted February 20, 2013 cineva? nu stie nimeni? Quote
eusimplu Posted February 21, 2013 Report Posted February 21, 2013 Deci tu ce vrei pana la urma? Un button de „select all” sau un script ce blocheaza submitul cand nu este selectat nimic? Quote
3mPtY Posted February 24, 2013 Report Posted February 24, 2013 Repeta codul de mai multe ori (in functie de cate produse ai) si modifica aici "var F = document.forms["page1"];" in loc de "page1" pui altceva. Quote
bajetzashu89 Posted February 25, 2013 Author Report Posted February 25, 2013 am incercat asta deja,si tot nu funtiona,pana la urma am facut eu un script mai simplu si l-am repetat .ms pt raspuns ! Quote