Please help me. I have a parent window, where is user input database into mySQL database, there is a select box to choose data from other table, if data is not exists. User press a button to open child window to input new data. I use php code and javascript:
Java script In parent window
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- function MM_openBrWindow(theURL) {
- mywindow=window.open('input_typemachine_sub1.php?series=' + document.getElementById('series').value + '&seriesmachine=' + document.getElementById('series_machine').value,'','width=430,height=430');
- mywindow.focus()
- }
Expand|Select|Wrap|Line Numbers
- <select name="typecode" id="typecode" >
- <option value=""></option>
- <?php
- $sql="SELECT typecode, concat(typecode,' - ',Describe_VN) as typedes
- FROM typemachine";
- $result=mysqli_query($conn,$sql) or die(mysqli_error($conn));
- while($row=mysqli_fetch_assoc($result)){
- echo "<option value='$row[typecode]'";
- $temp=isset($_POST['typecode']) ? $_POST['typecode'] : false;
- if($temp == $row['typecode']) { echo "selected='selected'";}
- echo ">$row[typedes]</option>";
- }
- ?>
- </select>
- <input name="newtype" type="button" id="newtype" onClick="MM_openBrWindow()" value="New Type"/>
Expand|Select|Wrap|Line Numbers
- function typecodeclose(){
- opener.document.getElementById('series2').value=document.getElementById('series').value;
- self.close();
- }
Can you help me?