Jump to content

rooney

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by rooney

  1. Guys when I am making it as onClick="register_form.submit.disabled=false; it is proceeding as expected. But when i make it onClick="register_form.submit.disabled=true; it is showing the stated problem
  2. Hi friends I have a form in which there is a form. When you submit the form without using javascript to disable the submit button after it has been pressed, the form proceeds normally (stating any errors in form or successfully if no errors found). But when I put in disable code, the button just shows "Please wait.." and the page simply reloads(no checks performed whatsoever). Heres my code. Please tell me what the error is. 1 bug i have found in the below code. When the page reloads after clicking the submit button ,isset($_POST['submit']) returns false . This returns true when the function is not being called. <?php //form code ?> <script language="Javascript"> document.write('<input type="submit" name="submit" value="Submit" onClick="register_form.submit.disabled=true;">'); </script> <noscript> <input type="submit" name="submit" value="Submit"> </noscript> <?php echo "<input type='hidden' name='isrun' value='true'>"; echo "</form>"; //other codes ?>
  3. $sql = "UPDATE table info SET approval=1 WHERE id=$ID "; had to be changed to $sql = "UPDATE table info SET approval='1' WHERE id=$ID "; Problem solved. Thanks a lot , Mad techie!
  4. What you suggested makes perfect sense. But still not working. I think we might need separate names for all the buttons. like name="approve_".$id[$i] I am trying to figure out something.
  5. Hello friends I need some help regarding a site i am making. I need to finish it really very urgently but seem to be stuck at this point. The problem is that I am displaying all the rows of my table which have the value of the field 'approval' as 0. Now, there are to be 2 buttons next to each row with names "Approve" and "Disapprove". If you click on approve, then the value of 'approval' for that row becomes 1 and if you click on "Disapprove" , the value of 'approval' becomes -1. How to accomplish it ? as the list being viewed will be changing very often. I used this for loop for displaying the list and the corresponding boxes~ db_connect(); $query="SELECT * from info where approval=0"; $process=mysql_query($query); $num=mysql_num_rows($process); for($i = 0; $i< $num; $i++) { $row = mysql_fetch_assoc($process); $title[$i]=$row['title']; $url4[$i]=$row['url']; $widget[$i]=$row['widget']; $box[$i]=$row['box']; $button[$i]=$row['button']; $id[$i]=$row['id']; } echo "<table width=100% border='2' cellpadding='10' align='center'>"; echo " <th>title</th> <th>url</th> <th>widget</th> <th>box</th> <th>button</th>"; //displaying the list for($i = 0; $i< $num; $i++) { echo "<tr>"; echo "<td>".$title[$i]."</td>"; echo "<td>".$url4[$i]."</td>"; echo "<td>".$widget[$i]."</td>"; echo "<td>".$box[$i]."</td>"; echo "<td>".$button[$i]."</td>"; echo "<td>"; //creating two buttons - Approve and Disapprove echo "<form name='approve' method='post' action='pending.php'>\n"; echo "<input type= 'Submit' name= 'approve' value='approve' "; echo"</td>"; echo "<td>"; echo "<form name='disapprove' method='post' action='pending.php'>\n"; echo "<input type= 'Submit' name= 'disapprove' value='Disapprove' "; echo"</td>"; echo "</tr>"; //Trying to perform the desired action but not working if(isset($_POST['approve'])) { $sql = "UPDATE table info SET approval=1 WHERE url='". $url[$i] ."' "; $result = mysql_query($sql); } if(isset($_POST['disapprove'])) { $sql = "UPDATE table info SET approval=-1 WHERE url='". $url[$i] ."' "; $result = mysql_query($sql); } } ------------------------------------------------------------- There is the normal end coding after this. So, can anyone please suggest a way for me to do this ? Its very very very urgent. Almost a question of life and death at the moment. I request you to get me through this. Thanks to you all, Rooney
  6. Thanks guys The problem got solved =)
  7. I am using a php mysql database and have 3 checkboxes in my form. I have one column for each checkbox. I want that if a user checks a box, the value that goes into the corresponding colum should be 1 , else 0. The data type i selected for the column is BOOL. But how to accomplish the storing of data into the table ?. Been trying for long but no success. Thanks in advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.