www.webdeveloper.com
Results 1 to 5 of 5

Thread: I need help Checkbox

Hybrid View

  1. #1
    Join Date
    Oct 2012
    Location
    istanbul
    Posts
    61

    I need help Checkbox

    Hello,

    I'm sorry my English is bad

    I have a checkbox 5 units
    Namesake all (name="uydular[]") (value="4")availability?

    Checkbox_1
    Checkbox_2
    Checkbox_3
    Checkbox_4
    Checkbox_5

    Rule:

    Checkbox_4 with total 3 selectable

    Checkbox_4 except total 2 selectable

    I'm beginner

    Could help?


    Best Regards
    Adem
    Last edited by Adem; 10-30-2012 at 06:06 AM.

  2. #2
    Join Date
    Aug 2003
    Location
    Sydney, Australia
    Posts
    700
    I'm sorry Adem,

    I'm not sure I understand the question, but I will try to help if I can.

    What is it that you are trying to do with the checkboxes?

    In other words, if I click checkbox 4, what happens?

    CTB
    Oh Lord, please help me be the person my dog thinks I am.

  3. #3
    Join Date
    Oct 2012
    Location
    istanbul
    Posts
    61
    Thank you for your answer

    I am producing
    while {
    ............
    }

    and checkbox.

    The rules:

    You can choose maximum 2 boxes but with choosing Checkbox_4, you can choose 3 boxes.
    All of the name values are the same: name="satelite[]"
    Is it possible to check by using value="4"

    http://www.teklif.uzayforum.com/adim2.php

    Regards
    Adem

  4. #4
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    776
    Check to see if this is what you're looking for...

    Code:
    <script type="text/javascript">
    
    	function checkSatelites(e)
    	{
    		var items = e.form.elements[e.name], i, j;
    		for (i = 0, j = 0; i < items.length; ++i) {if (String(items[i].value) !== '4' && items[i].checked) {++j;}}
    		return j < 3;
    	}
    
    </script>
    <form>
    	<table border="1" style="margin: 0 auto;">
    		<tr>
    			<td>Türksat 2A/3A @ 42° East</td>
    			<th><input type="checkbox" name="secilen_uydu_id[]" value="1" onclick="return checkSatelites(this);" /></th>
    		</tr>
    		<tr>
    			<td>Hot Bird 13A/13B/13C @ 13° East</td>
    			<th><input type="checkbox" name="secilen_uydu_id[]" value="2" onclick="return checkSatelites(this);" /></th>
    		</tr>
    		<tr>
    			<td>Eutelsat 7A @ 7° East</td>
    			<th><input type="checkbox" name="secilen_uydu_id[]" value="3" onclick="return checkSatelites(this);" /></th>
    		</tr>
    		<tr>
    			<td>Badr-4/5/6 @ 26° East</td>
    			<th><input type="checkbox" name="secilen_uydu_id[]" value="4" onclick="return checkSatelites(this);" /></th>
    		</tr>
    		<tr>
    			<td>Astra 1H/1KR/1L/1M/2C @ 19.2° East</td>
    			<th><input type="checkbox" name="secilen_uydu_id[]" value="5" onclick="return checkSatelites(this);" /></th>
    		</tr>
    	</table>
    </form>
    Last edited by bionoid; 10-31-2012 at 04:39 PM.
    JavaScript: Learn | Validate | Compact

  5. #5
    Join Date
    Oct 2012
    Location
    istanbul
    Posts
    61
    trying to, Thank you very, very much

    Greetings from Turkey
    Best Regards

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles