942,956 Members | Top Members by Rank

Ad:
Aug 15th, 2010
0

div not working on success

Expand Post »
hi
i am hoping that i can explain my predicement properly. i have a form on a page that is working the jquery form plugin. if i use the form in a normal html environment then the form works and the success is placed in the correct div '#f1'. however, if i call the form from any modal window or box environments such as facebox or facy box etc then instead of the success being echoed to the '#f1' div it goes to the php page that does the processing and shows the response there. i hope i have made it clear and have posted my code in the hope that someone can offer some advice. many thanks

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. form
  2. ---------------------------------------------
  3.  
  4. <div id="addform" style="display:none;">
  5. <form id="fileform" action="filesadd.php" method="post" class="webform">
  6. <fieldset>
  7. <legend><span>Enter a File</span></legend>
  8. <label for="box">Select a Box</label>
  9. <select name="box">
  10. <option SELECTED VALUE="">Select a Box</option>
  11. <?php
  12. do {
  13. ?>
  14. <option value="<?php echo $row_Recordset1['boxref']?>"><?php echo $row_Recordset1['boxref']?></option>
  15. <?php
  16. } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1));
  17. $rows = mysql_num_rows($Recordset1);
  18. if($rows > 0) {
  19. mysql_data_seek($Recordset1, 0);
  20. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  21. }
  22. ?>
  23.  
  24. </select>
  25. <label for="fileno">File Number:</label>
  26. <input id="fileno" name="fileno" class="text" type="text" />
  27. <div id="f1"></div>
  28. <label for="authorised">Authorised By:</label>
  29. <input name="authorised" type="text" class="text" id="authorised" value="<?php echo $_SESSION['kt_name_usr']; ?>" />
  30. </fieldset>
  31. <input class="submit" type="submit" name="submit" value="Add File" />
  32. </form>
  33. </div>

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. open the form
  2. --------------------------------------------------------
  3. This is called from onpress event.
  4.  
  5. <script type="text/javascript">
  6. function fileadd(){
  7. jQuery.facybox({ div: '#addform' });
  8. }
  9. </script>

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. process the form
  2. -------------------------------------------------------
  3.  
  4. <script type="text/javascript">
  5. // prepare the form when the DOM is ready
  6. // bind form using ajaxForm
  7. $('#fileform').ajaxForm({
  8. // target identifies the element(s) to update with the server response
  9. target: '#f1',
  10. // success identifies the function to invoke when the server response
  11. // has been received; here we apply a fade-in effect to the new content
  12. success: function() {
  13. $('#f1').fadeIn('slow');
  14. }
  15. });
  16.  
  17. </script>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ploppy is offline Offline
21 posts
since Jul 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: Apply variable to hyperlink label
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Get acces to a Radio Button





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC