• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Help] with <select> auto reload

#11
[eluser]marjune[/eluser]
yeah ajax its perfect

#12
[eluser]C_Line[/eluser]
Code:
<td>
[removed][removed]
[removed]
$(document).ready(function()
{
$(".propinsi").change(function()
{
var id=$(this).val();

$.ajax
({
type: "POST",
url: "&lt;?php echo base_url();?&gt;index.php/main/sel_kota/",
data: id,
cache: false,
success: function(html)
{
$(".kota_user").html(html);
}
});

});

});
[removed]

<h1><center>Registrasi</center></h1>
&lt;form name="form1" method="post" action="&lt;?php echo $_SERVER['PHP_SELF'];?&gt;"&gt;
<table align="center">
<tr><td>Nama : </td><td>&lt;input type="text" id="nama" name="nama" value="&lt;?php echo $_SESSION['names']; ?&gt;"&gt;&lt;/td></tr>
<tr><td>Password : </td><td>&lt;input type="password" id="pass" name="pass" value="&lt;?php echo $_SESSION['password']; ?&gt;"&gt;&lt;/td></tr>
<tr><td>Konfirmasi Password : </td><td>&lt;input type="password" id="kpass" name="kpass" value="&lt;?php echo $_SESSION['confirm_pass']; ?&gt;"&gt;&lt;/td></tr>
<tr><td>Propinsi</td><td>
<select name="propinsi" class="propinsi">
&lt;?php
foreach($prop as $kue)
{
?&gt;
<option value="&lt;?php echo $kue-&gt;Propinsi; ?&gt;">&lt;?php echo $kue->Propinsi; ?&gt;</option>
&lt;?php
}
?&gt;
</select>
</td></tr>

<tr><td>Kota</td><td>
<select name="kota_user" class="kota_user">
<option selected="selected">--Select City--</option>
</select>
</td></tr>

why can't load?
anyone can explain me how jquery above work?
like $(document).ready(function()
thx


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.