javascript - how to get datable row on click values in the form with PHP -
i wish u me solve this.here form , table without css , js
<form class="form-horizontal"> <div class="form-group"> <label class="col-md-3 control-label">event id</label> <div class="col-md-9"> <input type="text" class="form-control" placeholder="event id" name="eventid" disabled /> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">start time</label> <div class="col-md-9"> <input type="text" class="form-control" placeholder="start time" name="start" disabled /> </div> </div> <div class="form-group has-error has-feedback"> <label class="col-md-3 control-label">title-en</label> <div class="col-md-9"> <input type="text" class="form-control" placeholder="title-en" name="title-en" /> </div> </div> <div class="form-group has-warning has-feedback"> <label class="col-md-3 control-label">content type</label> <div class="col-md-9"> <select class="form-control" name="contenttype"> <option value="000">000-undefined</option> <option value="016">016-movie/drama</option> <option value="032">032-news/current affairs</option> <option value="048">048-show/game show</option> <option value="064">064-sports</option> <option value="080">080-children's/youth programmes</option> <option value="112">112-arts/culture</option> <option value="128">128-social/political issues/economics</option> <option value="144">144-educational/science/factual topics</option> <option value="160">160-leisure hobbies</option> <option value="176">176-special characteristics</option> </select> </div> </div> <div class="form-group has-warning has-feedback"> <label class="col-md-3 control-label">rating</label> <div class="col-md-9"> <select class="form-control" name="rating"> <option value="00">00-undefined</option> <option value="01">01-4 years</option> <option value="02">02-5 years</option> <option value="03">03-6 years</option> <option value="04">04-7 years</option> <option value="05">05-8 years</option> <option value="06">06-9 years</option> <option value="07">07-10 years</option> <option value="08">08-11 years</option> <option value="09">09-12 years</option> <option value="10">10-13 years</option> <option value="11">11-14 years</option> <option value="12">12-15 years</option> <option value="13">13-16 years</option> <option value="14">14-17 years</option> <option value="15">15-18 years</option> <option value="16">16-defined broadcaster</option> </select> </div> </div> <div class="form-group has-error has-feedback"> <label class="col-md-3 control-label">shortdesc-en</label> <div class="col-md-9"> <input type="text" class="form-control" placeholder="shortdescription-en" name="shortdesc-en" /> </div> </div> <div class="form-group has-error has-feedback"> <label class="col-md-3 control-label">longdesc-en</label> <div class="col-md-9"> <textarea class="form-control" placeholder="longdescription-en" name="longdesc-en" rows="10"></textarea> </div> </div> <div class="form-group"> <label class="col-md-3 control-label">update</label> <div class="col-md-9"> <button type="submit" name="update" class="btn btn-sm btn-primary">update</button> </div> </div> </form>
this form fill. , table
<table id="data-table" class="table table-striped table-bordered"> <thead> <tr class="active"> <th>id</th> <th>title</th> <th>shortdesc</th> <th>longdesc</th> <th>title-ge</th> <th>shortdesc-ge</th> <th>longdesc-ge</th> <th>title-en</th> <th>shortdesc-en</th> <th>longdesc-en</th> </tr> </thead> <tbody> <?php if(isset($_post['title']) || (isset($_post['time'] ) ) ) { while ($row = mysqli_fetch_array ($result)) { if(($row['channelname'] == $_post['title']) && ($row['bl_all']==0) || (($row['time'] == $_post['time']) ) ) { //echo $row['date'] . "<br>"; if (($row['channelname'] == $_post['title']) && ($row['bl_all']==0) && (($row['time'] == $_post['time'])) ) { echo '<tr class="danger"> <td>'.$row["eventcounter"].'</td> <td>'.$row["title"].'</td> <td>'.$row["shortdesc"].'</td> <td>'.$row["longdesc"].'</td> <td>'.$row["title-ge"].'</td> <td>'.$row["shortdesc-ge"].'</td> <td>'.$row["longdesc-ge"].'</td> <td>'.$row["title-en"].'</td> <td>'.$row["shortdesc-en"].'</td> <td>'.$row["longdesc-en"].'</td> </tr>'; } elseif (!$_post['time'] ) { echo '<tr class="danger"> <td>'.$row["eventcounter"].'</td> <td>'.$row["title"].'</td> <td>'.$row["shortdesc"].'</td> <td>'.$row["longdesc"].'</td> <td>'.$row["title-ge"].'</td> <td>'.$row["shortdesc-ge"].'</td> <td>'.$row["longdesc-ge"].'</td> <td>'.$row["title-en"].'</td> <td>'.$row["shortdesc-en"].'</td> <td>'.$row["longdesc-en"].'</td> </tr>'; } elseif ($_post['time'] && !($_post['title']) ) { echo '<tr class="danger"> <td>'.$row["eventcounter"].'</td> <td>'.$row["title"].'</td> <td>'.$row["shortdesc"].'</td> <td>'.$row["longdesc"].'</td> <td>'.$row["title-ge"].'</td> <td>'.$row["shortdesc-ge"].'</td> <td>'.$row["longdesc-ge"].'</td> <td>'.$row["title-en"].'</td> <td>'.$row["shortdesc-en"].'</td> <td>'.$row["longdesc-en"].'</td> </tr>'; } } } } ?> </tbody> </table>
i want
1) on datable row clicking values in form(e.g click row id=1 values)
2)check values in mysql database , fill (rating,content-type) values database. solutions in example please. thanks
Comments
Post a Comment