soprano Posted December 18, 2011 Report Share Posted December 18, 2011 Nevarēju nekur atrast,bet kāds var palīdzēt ar input formu? Pieņemsim ir textarea un submit poga ierkastot textarea pimēram tekstu php.lv nospiežot submit atver php.lv forumu Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 18, 2011 Report Share Posted December 18, 2011 **HTML:** <form action="#"> <input id="jump_to" /> <button id="jump">Jump</button> </form> **JavaScript (jQuery):** $('#jump').click(function() { window.location = $('#jump_to').val(); return false; }); Tas ar javaScript. Taisīt to pašu ar PHP liela jēga nav; zinot tik cik mēs zinam. :P Quote Link to comment Share on other sites More sharing options...
Maris-S Posted December 21, 2011 Report Share Posted December 21, 2011 Nezinu tikai vai tik vienkāršam uzdevumam vajadzētu vilkt līdzi jquery... Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 21, 2011 Report Share Posted December 21, 2011 Bez problēmām to var izdarīt arī bez JQuery - tikai ar JavaScript! Ja viņam nav jQuery - lai taisa ar JavaScriptu. Es ideju - kā to izdarīt - parādīju. Quote Link to comment Share on other sites More sharing options...
Kracker Posted January 8, 2012 Report Share Posted January 8, 2012 Piemērs ar select-u. :) <script type="text/javascript"> function adrese(elm) { window.location = "http://"+elm.value; } </script> <select onchange="javascript:adrese(this)"> <option value="">- Izvēlies -</option> <option value="google.lv">google.lv</option> <option value="php.lv">php.lv</option> </select> Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted January 10, 2012 Report Share Posted January 10, 2012 <form onSubmit="window.location.href=this.url.value;return false;"><input name="url"><input type="submit"></form> sorry, nepamanīju, ka tik briesmīgi vecs. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted January 11, 2012 Report Share Posted January 11, 2012 In-line JavaScript nav gluži tas, ko es vēlētos 2012. redzēt. :D Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted January 11, 2012 Report Share Posted January 11, 2012 Tu tā ka boss? Quote Link to comment Share on other sites More sharing options...
daGrevis Posted January 11, 2012 Report Share Posted January 11, 2012 Es vienkārši domāju, ka tas nav labākais stils. Tev tā neliekas? Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted January 11, 2012 Report Share Posted January 11, 2012 Nu labi, boss, ja jau saki, tad tā arī ir :) Drukāju on the fly, nepretendējot uz neko īpašu. Quote Link to comment Share on other sites More sharing options...
daGrevis Posted January 11, 2012 Report Share Posted January 11, 2012 Neesmu boss! :D Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.