mencari data dengan radio button

Hirata Afriandry S · Jun 26, 2014
<script>
$(document).ready(function(){  	
	$("#nowoption").show();
	$("#manually").hide();
	$("input[name='senddateoption']").click(function() {
		if($(this).val()=='option1')  { $("#nowoption").show(); }	
	});

	$("input[name='sendoption']").click(function() {
		if($(this).val()=='sendoption1')  { $("#person").show(); }
	});	
});
</script>
<h4>Silahkan Isi Form ini untuk mengirimkan SMS</h4>
<fieldset>
<?php
echo form_open('sendsms');
$nomor     = "";
$datainbox = $this->Mysms_model->getInbox('all');
		foreach($datainbox->result() as $tmp):
					$idnya  = $tmp->ID;
					$dataname ="nomor$idnya";
						if($this->input->post($dataname) != null) {
							$nomor = $tmp->SenderNumber;
							$this->Kalkun_model->masukYa1($idnya);
						}
		endforeach;
?>
<table>
	<tr>
        <td width="125px" align="right"><b>Send to</b></td><td width="30px"> : </td>
        <td><input type="radio" name="sendoption" value="sendoption1" checked="checked">Input Manual &nbsp;
		<input type="radio" name="sendoption" value="sendoption2" checked="checked"/>
        Phonebook
</div> 
        </td>    
    </tr>
    <tr>
    	<td colspan="2">&nbsp;</td>
    	<td><br>
    	<div id="person">
    	   	<div class="note">(Ketikkan Nomor HP, bila lebih dari satu, pisahkan dengan tekan tombol Enter)</div>
    		<textarea cols="30" rows="3" name="personvalue"><?php echo $nomor; ?></textarea>
    	</div>
    	</td>
    </tr>
     <tr>
        <td align="right">Send date</td><td> : </td>
        <td><input type="radio" name="senddateoption" value="option1" checked="checked">Now &nbsp;
        </td>    
    </tr>  
     <tr valign="top">
        <td align="right"><b>No Surat</b></td><td> : </td><td><b><input type="text" style="width" name="no surat" />
        <tr valign="top">
        <td align="right"><b>Subject</b></td><td> : </td><td><b><input type="text" style="width" name="subject" />
        <tr valign="top">
		 <td align="right"><b>From</b></td><td> : </td><td><b><input type="text" style="width" name="from" />
        <tr valign="top">
        <td align="right"><b>Date</b></td><td> : </td><td><b><input type="Date" style="width"  name="Date" />
    <tr valign="top">
        <td align="right"><b>Message</b></td><td> : </td><td><b>
        <textarea class="word_count" cols="45" rows="5" name="message"></textarea><br /><span class="counter"></span></b></td>    
    </tr>    
</table>
<br />
<div align="center"><input type="submit" id="submit" value="Send SMS" /></div>
<?=form_close();?>
</fieldset>
<?php if ($validation_error !='') { ?>
<script type="text/javascript">
          alert("<?=$validation_error?>");
</script>
<?php } ?>

maff mau tanya kalo pencarian data dengan ceked radio button gimana yahh soalnya saya ada pemilihan pengisian data yaitu secara manual dan mencari data otomatis dari database lewat radio button mohon pencerahannya
Silahkan login untuk menjawab!