Jump to content
php.lv forumi

Input forma


soprano

Recommended Posts

**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

Link to comment
Share on other sites

  • 3 weeks later...

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>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...