By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

Submitting form to mysql

P: 5
Hi I have a form with drop down boxes, tinymce and an ajax file up-loader I want to be able to submit the form and store all the data on a mysql db the trouble I have is I do not know how to reference the tinymce (they have a lack of decent documentation) or I am trying to over complicate things

The idea is a new job will be created and stored in a database for retrieval at a later date I want to be able to show the form contents and links to the files that were submitted

this is my form code

Expand|Select|Wrap|Line Numbers
  1.       <div align="center" class="column1a">
  2.  
  3.                   <form method="post" action="<?=$_SERVER['REQUEST_URI']?>"> 
  4.  
  5.     <div>
  6.                 <div>
  7. <?     
  8.      echo "<form name=jobinfo>\n";
  9.      echo "Type : : <font id=type><select>\n";
  10.      echo "<option value='0'>== Type ==</option> \n" ;
  11.      echo "</select></font>\n";
  12.  
  13.      echo "Dept : <font id=dept><select>\n";
  14.      echo "<option value='0'>== Dept ==</option> \n" ;
  15.      echo "</select></font>\n";
  16.  
  17.      echo "Priority : <font id=priority><select>\n";
  18.      echo "<option value='0'>==== Priority ====</option> \n" ;
  19.      echo "</select></font>\n";
  20. ?>
  21.  
  22. <script language=Javascript>
  23. function Inint_AJAX() {
  24.    try { return new ActiveXObject("Msxml2.XMLHTTP");  } catch(e) {} //IE
  25.    try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) {} //IE
  26.    try { return new XMLHttpRequest();          } catch(e) {} //Native Javascript
  27.    alert("XMLHttpRequest not supported");
  28.    return null;
  29. };
  30.  
  31. function dochange(src, val) {
  32.      var req = Inint_AJAX();
  33.      req.onreadystatechange = function () { 
  34.           if (req.readyState==4) {
  35.                if (req.status==200) {
  36.                     document.getElementById(src).innerHTML=req.responseText; //ѺҡѺ
  37.                } 
  38.           }
  39.      };
  40.      req.open("GET", "include/ajaxlist.php?data="+src+"&val="+val); //ҧ connection
  41.      req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=tis-620"); // set Header
  42.      req.send(null); //觤
  43. }
  44.  
  45. window.onLoad=dochange('type', -1);     
  46. </script>
  47. <br />
  48. <br />
  49.  
  50. <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 60%" class="tinymce"><?php echo $sContent;?></textarea>    
  51.             </textarea>
  52.         </div>
  53.  
  54.         <!-- Some integration calls -->
  55.     <!--    <a href="javascript:;" onmousedown="$('#elm1').tinymce().show();">[Show]</a>
  56.         <a href="javascript:;" onmousedown="$('#elm1').tinymce().hide();">[Hide]</a>-->
  57.     <div align="left" id="swfupload-control">
  58.     <p>    Upload upto 5 files(jpg, png, gif, doc, docx, pdf,), each having maximum size of 5MB</p>
  59.     <input type="button" id="button" />
  60.     <p id="files" ></p>
  61.     <ol id="log"></ol>
  62. </div>
  63.  
  64.  
  65.         <br />
  66.         <input type="submit" name="save" value="Submit" />
  67.         <input type="reset" name="reset" value="Reset" />
  68.     </div>
  69. </form></pre></code> 

I don't need to edit text from the tinymce I thought it made a nice text box I could just use a bog standard txtBox, and with regards to the ajax file upload I cannot figure out how to store the file locations

thanks

Mike
Dec 7 '09 #1
Share this Question
Share on Google+
2 Replies


P: 5
I never used it, but, can't you just capture the data from the textarea?


-------------------------------------
xatcom.net, diseo web
Dec 15 '09 #2

kovik
Expert 100+
P: 1,044
Most WYSIWYG editors simply hide your textarea and allow input into an area with HTML parsing. However, they keep the textarea updated. Like ~carmarri said, you only have to access the actual textarea.

If you do not know what part of the $_POST array it is in, print_r() the array.
Dec 15 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.