Results 1 to 11 of 11

Thread: select

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User bombov's Avatar
    Join Date: Jan:2007
    Location:
    Posts: 260

    select

    jobs.bg , .

    :

    <select id="selectCategory">
    <option>1</option>
    <option>1</option>
    <select>

    <select id="SelectedCatogories" multiple="multiple">
    </select>
    o :
    Code:
    	
    $('#selectCategory option').click(function()
    {
    $('#SelectedCatogories').append('<option>'+$(this).text()+'</option>');
    }
    , , .
    //1//
    /* $(this).appendTo('#SelectedCatogories'); */
    //2//
    $('#SelectedCatogories').html(thisValue) ;
    //3//
    //$('#SelectedCatogories').append($(this)) ;

    .

  2. #2
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by bombov View Post
    //1//
    /* $(this).appendTo('#SelectedCatogories'); */
    //2//
    $('#SelectedCatogories').html(thisValue) ;
    //3//
    //$('#SelectedCatogories').append($(this)) ;

    .
    :
    Code:
    $(this).clone().appendTo('#SelectedCatogories');

  3. #3
    Registered User bombov's Avatar
    Join Date: Jan:2007
    Location:
    Posts: 260
    Quote Originally Posted by genn View Post
    :
    Code:
    $(this).clone().appendTo('#SelectedCatogories');
    . , . .

    :

    Code:
    $(function() 
    {
    	$('#selectCategory option').click(function()
    	{	
    		if($(this).attr('value') != 0)
    		{
    			if($(this).attr('disabled') != true && $(this).text() !='')
    			{
    				$(this).clone().appendTo('#SelectedCatogories');
    				$(this).attr('disabled','disabled');
    			}
    		}
    	});
    	$('#remove').click(function() //input[type="button"]
    	{ 
    		var value = "";
    		$('#SelectedCatogories :selected').each(function(i, selected){
    		    value = $(selected).attr('value');
    		    $("#selectCategory option").each(function()
    		    {
    		    	if(value == $(this).attr('value'))
    		    	{
    		    		$(selected).remove();
    		    		$(this).attr("disabled",false);
    		    	}
    		    });
    		});
    	});
    });
    Firefox.
    Last edited by bombov; 11th February 2010 at 17:52.

  4. #4
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    ?
    :

    1. -"", if-.
    :
    Code:
    $('#selectCategory option')
    , , option-, , .

    2. , .
    , .

  5. #5
    Registered User bombov's Avatar
    Join Date: Jan:2007
    Location:
    Posts: 260
    .

    :
    http://jeradbitner.com/content/jquer...select-options



    Code:
    $('#selectCategory option').click(function()
    {
    alert('option was Clicked');
    });
    FF.

    :

    <select id="selectCategory" onchange="selectChange()">
    ...
    </select>

    : http://82.103.68.218/Obqvi/userPanel/

    :

    Code:
    $(function() 
    {
    	$('#remove').click(function() 
    	{ 
    		var value = "";
    		$('#SelectedCatogories :selected').each(function(i,selected){
    		    value = $(selected).attr('value');
    		    $("#selectCategory option").each(function()
    		    {
    		    	if(value == $(this).attr('value'))
    		    	{
    		    		$(selected).remove();
    		    		$(this).attr("disabled",false);
    		    		$(this).css('color','black'); // IE6
    		    	}
    		    });
    		});
    	});
    });
    
    function selectChange()
    {
    	$('#selectCategory :selected').each(function()
    	{
    		if($(this).attr('value') != 0)
    		{
    			if($(this).attr('disabled') != true && $(this).text() !='')
    			{
    				$(this).clone().appendTo('#SelectedCatogories');
    				$('#multiSelectDiv').fadeIn('slow');
    				$(this).attr('disabled','disabled');
    				$(this).css('color','#6d6d6d'); // IE6
    			}
    		}
    	});

  6. #6
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by bombov View Post
    .

    :
    http://jeradbitner.com/content/jquer...select-options



    Code:
    $('#selectCategory option').click(function()
    {
    alert('option was Clicked');
    });
    FF.

    :

    <select id="selectCategory" onchange="selectChange()">
    ...
    </select>
    .
    jQuery, - . jQuery, , .

    click .
    .change(), .click():

    Code:
    $("select").change( function()
    {
    alert('option was Clicked');
    });
    .
    option :

    Code:
    $("select option:selected")
    jQuery.
    jQuery ,

  7. #7
    Registered User bombov's Avatar
    Join Date: Jan:2007
    Location:
    Posts: 260
    change , <option> <select>-a.

  8. #8
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798
    this onchange="selectChange(this, $(''#SelectedCatogories'))". , this $(this), , jquery. selectChange: function selectChange(from, to) { .. }, jquery.

  9. #9
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by _ShadoW_ View Post
    this onchange="selectChange(this, $(''#SelectedCatogories'))". , this $(this), , jquery. selectChange: function selectChange(from, to) { .. }, jquery.
    ?
    jQuery, ...
    ...

  10. #10
    Registered User
    Join Date: Jul:2005
    Location: Sofiq
    Posts: 2,798
    Quote Originally Posted by genn View Post
    ?
    jQuery, ...
    ...
    . jquery , js? jquery . 90% 5 a . jquery, framework JavaScript.

    java script , .

  11. #11
    Registered User genn's Avatar
    Join Date: Feb:2003
    Location:
    Posts: 1,215
    Quote Originally Posted by _ShadoW_ View Post
    .
    , - :

    Quote Originally Posted by _ShadoW_;
    ... jquery
    , jQuery, , , , .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |