tiy Posted March 26, 2006 Report Share Posted March 26, 2006 Kavar panakt submit , kas izskatas pec linka. piemera ir kada forma un nav poga bet ir text links, ka to var izdarit? Link to comment Share on other sites More sharing options...
Stopp Posted March 26, 2006 Report Share Posted March 26, 2006 <form name="hmm" action="?" method="post"><input ..><textarea ..></textarea></form> <a href="java script: document.hmm.submit();">submit links</a> tikai javascript kopā. Link to comment Share on other sites More sharing options...
tiy Posted March 26, 2006 Author Report Share Posted March 26, 2006 (edited) <form name="hmm" action="?" method="post"><input ..><textarea ..></textarea></form> <a href="java script: document.hmm.submit();">submit links</a> <input ..> kam jabut input vieta hiden ? Ka man izsaukt php funkcija, kas ir tani pasha faila? man rada shito You don't have permission to access /java script: document.hmm.submit(); on this server. Edited March 26, 2006 by tiy Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 26, 2006 Report Share Posted March 26, 2006 (edited) tiy --> <input ..><textarea ... tavi formas lauki kaads sakars ar hiden ? Sveeti iesaku palasiit par HTML... un vispaar shis jautaajumam nav nekaada sakara ar PHP.... HTML + JavaScript.. un labaak ir shaadi: <a href="java script:void(0)" OnClick="document.formas_nosaukums.submit()">bla bla</a> ja links ir formaa tad vienkarshaak <a href="java script:void(0)" OnClick="submit()">bla bla</a> edit: piebilde par php f-ju <?php function mana_funkcija() { echo 'bla'; } mana_funkcija() ?> Edited March 26, 2006 by Grey_Wolf Link to comment Share on other sites More sharing options...
Stopp Posted March 26, 2006 Report Share Posted March 26, 2006 man rada shitoYou don't have permission to access /java script: document.hmm.submit(); on this server. jau teicu:tikai javascript kopā. Link to comment Share on other sites More sharing options...
tiy Posted March 26, 2006 Author Report Share Posted March 26, 2006 (edited) if (isset($_POST['submit'])) { mana_funkcija(); } <form action="" method="post" name="main"> <input type="text"> <input type="submit" name="done" value="submit"> // tad ka var shita vieta izsaukt JS nav poga, bet links </form> Iepreiksh laikam nekorekti uzdevu jautajumu par funkciju ta es gribu. Edited March 26, 2006 by tiy Link to comment Share on other sites More sharing options...
Stopp Posted March 26, 2006 Report Share Posted March 26, 2006 (edited) <form action="" method="post" name="main"> <input type="text"> <a href="java script:document.main.submit();">.</a> /* Grey_Wolf teica, ka iekš formas varot vienk submit();, es neesmu to pārbaudījis.. */ </form> tikai javascript ir kopā. šeit pie posta pievienošanas automātiski atdala. bet kas ar to funkciju ? Edited March 26, 2006 by Stopp Link to comment Share on other sites More sharing options...
Blitz Posted March 27, 2006 Report Share Posted March 27, 2006 nevar saprast... ja gribi submitot formu nevis ar to pogu bet linku tad formai pieliec id="main" <a href="#" onclick=main.submit()>submit</a> Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 27, 2006 Report Share Posted March 27, 2006 Blitz--> nee dormai iisti ID neies... :( pec JS standartiem formu var izsaukt. (garais pieraksts) ------------- window.document.forms[iNDEX] window.document.forms["name"] window.document.forms.neme window.document.neme -------------------- window = Objekts kas satur vajadziigas formas elementus )pashu formu) tas var buut arii Freims.. INDEX = Formas iipashiibu masiiva index (peec buutiibas Visas formas ir Asociativie masiivi kur glabaajas to elementu iipashiibas ) name = formas vaards ;) ----------- teiksim: <form action="Bla.php" method="post" name="vardinsh"> tad pie shii formas var piekljuut: ----- window.document.forms[0] window.document.forms["vardinsh"] window.document.forms.vardinsh window.document.vardinsh --------------- window.document.forms[0] = 1 forma utt... (ja ir vairaakas formas tad var viegli sajukt kas ir kas) Link to comment Share on other sites More sharing options...
v3rb0 Posted March 27, 2006 Report Share Posted March 27, 2006 document.getElementById('formas_id').submit(); un izpildās laikam uz visiem browseriem ar js. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 27, 2006 Report Share Posted March 27, 2006 v3rb0--> :) nu jaa ja shaadi tad ID ir tieshi laikaa :) Link to comment Share on other sites More sharing options...
bubu Posted March 27, 2006 Report Share Posted March 27, 2006 document.getElementById('formas_id').submit(); un izpildās laikam uz visiem browseriem ar js. IE 5.0? Link to comment Share on other sites More sharing options...
tiy Posted March 27, 2006 Author Report Share Posted March 27, 2006 nevaru iebrauktm isti tad kads ir pieraksts, lai izsauktu php funkciju caur JS no formas Link to comment Share on other sites More sharing options...
Stopp Posted March 27, 2006 Report Share Posted March 27, 2006 ar js bez lapas pārlādes tu php neizsauksi nekā. ja domā pēc formas submitošanas, tad kaut kas tamlīdzīgs: <?php function mana_funkcija() { // funkcija } if (isset($_POST['forma']) && $_POST['forma']=='main') mana_funkcija(); ?> <form action="?" method="post" name="main"> <input type="text" name="tekstalauks"/> <input type="hidden" name="forma" value="main"/> <a href="java script:document.main.submit();">submit</a> </form> bet pārbaudīt, kura forma ir procesēta, var vairākos veidos. kaut vai pārbaudīt tikai, vai ir $_POST masīvā elements ar kādā formā esošā input/textarea/utt name, ja šāds name ir tikai šai formā. ja lieto submit pogu, nevis linku, tad izdevīgāk piešķirt name tai pašai submit pogai. ja failā ir tikai viena forma, tad var iztikt vienkārši ar if ($_SERVER['REQUEST_METHOD']=='POST') Link to comment Share on other sites More sharing options...
tiy Posted March 27, 2006 Author Report Share Posted March 27, 2006 <?php if (isset($_POST['forma']) && $_POST['forma']=='main') echo "kaut kas"; ?> <form action="" method="post" name="main"> <input type="text" name="tekstalauks"/> <input type="hidden" name="forma" value="main"/> <a href="java script:document.main.submit();">submit</a> </form> Es uzrakstiju bez f-jas, spiezu subit man shito vienmer rada VVVV You don't have permission to access /java script:document.main.submit(); on this server. Link to comment Share on other sites More sharing options...
Recommended Posts