hoho Posted May 27, 2008 Report Share Posted May 27, 2008 Veicot kaut kaadas darbiibas formaa ar Ajax tika pievienoti jauni lauki. Bet kad es submiteeju formu, Postaa es neredzu sos datus. Kaa so var risinaat? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 27, 2008 Report Share Posted May 27, 2008 sakuma parliecinies vai AJAX stradaa ar POST nevis GET .... (abi varjanti tiek plashi izmantoti) Link to comment Share on other sites More sharing options...
hoho Posted May 27, 2008 Author Report Share Posted May 27, 2008 Paldies, tur arii bija kljuuda. tagad ir OK! :) Link to comment Share on other sites More sharing options...
hoho Posted May 27, 2008 Author Report Share Posted May 27, 2008 hm..a vispaar tagad man paaraadaas "Length Required" :( Link to comment Share on other sites More sharing options...
marcis Posted May 27, 2008 Report Share Posted May 27, 2008 Tas nav nekāds standrta kļūdas paziņojums, skaties, kādā gadijumā kods izmet šādu kļūdu. Link to comment Share on other sites More sharing options...
hoho Posted May 27, 2008 Author Report Share Posted May 27, 2008 hmm...nu kaut ko es pielaboju. tagad es izsaucu funkciju: xmlHttp=GetXmlHttpObject() if (xmlHttp==null) { return false; } var url = "/abonesana/ajax2.php"; var params = "doo=yes"; xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlHttp.setRequestHeader("Content-length", params.length); xmlHttp.setRequestHeader("Connection", "close"); xmlHttp.onreadystatechange=updatePr3 ; xmlHttp.send(params); tad paaraadas jaunie formas lauki. bet peec submiteesanas es nesanjemu datus. kur ir probleema? Link to comment Share on other sites More sharing options...
andrisp Posted May 27, 2008 Report Share Posted May 27, 2008 Tas ko tu iepeistoji, nekādā ziņā nav funkcija un arī neatbild par jaunu lauku pievienošanu. Un izskatās, ka tu vienkārši nosūti doo=yes nevis formas datus. Link to comment Share on other sites More sharing options...
hoho Posted May 27, 2008 Author Report Share Posted May 27, 2008 Nu tas bija tikai piemeers, es nosuutu doo=yes, tad ta funkcija atgriez html un peec tam pamatformaa document.getElementById("testId").innerHTML=xmlHttp.responseText , tika pievienots tas HTMl -> jaunie lauki. Bet tam es taisu submitu, bet datus no tiem laukiem nesanjemu. Link to comment Share on other sites More sharing options...
andrisp Posted May 27, 2008 Report Share Posted May 27, 2008 Ā, skaidrs. Esi pārliecināts, ka tas HTML tiek ievietots iekš form tagiem nevis kaut kur "garām" ? Link to comment Share on other sites More sharing options...
hoho Posted May 27, 2008 Author Report Share Posted May 27, 2008 nu it kaa tas id testId, ir ieks formas: <form> <div id="testId"></div> </form> bet kad ielaadeejas tie jaunie lauki, sourcee es tos laikam nevaru redzeet?! Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 27, 2008 Report Share Posted May 27, 2008 ustaisi testiem mazinju JS funkciju function bla(id) { var xxxdocument.getElementById(id).value; alert(xxx); } un kautkur noliec linku <a href"java script:void(0)" onclick="bla('testejamais_id')" > test</a> un taad patestee vai vispar tiec tam laukam klat, vai pareizss id (name) utt... Link to comment Share on other sites More sharing options...
andrisp Posted May 27, 2008 Report Share Posted May 27, 2008 hoho, formai action="" un method="post" ir norādīts ? Link to comment Share on other sites More sharing options...
hoho Posted May 27, 2008 Author Report Share Posted May 27, 2008 Jaa, viss kaartiibaa, gan JS tests, gan formai ir action un method Link to comment Share on other sites More sharing options...
andrisp Posted May 27, 2008 Report Share Posted May 27, 2008 Varbūt iedot gatavu kodu. Mēs varētu patestēt. Varbūt tev tur kāda neuzmanības kļūda, ko pats neesi pamanījis. Link to comment Share on other sites More sharing options...
Recommended Posts