473,396 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Submitting form to mysql

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
2 2055
I never used it, but, can't you just capture the data from the textarea?


-------------------------------------
xatcom.net, diseño web
Dec 15 '09 #2
kovik
1,044 Expert 1GB
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

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

Similar topics

14
by: windandwaves | last post by:
Hi Folk This question has been bugging me for month. I have a website where people can enter stuff into a mysql database. Some of this information will already be shown in some textareas and...
1
by: Michael Brennan-White | last post by:
If I submit my for using a get action the resulting page loads . If I use a post action I get an error page saying "The page cannot be found". I am calling the originating page!!! This happens...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
1
by: PhoenixJ | last post by:
I have a question concerning ASP.NET 2.0 and MySQL. I would like to enter text into several text boxes in a Web form, and submit the information to a database through a "Submit" button control. I...
0
by: PhoenixJ | last post by:
I have a question concerning ASP.NET 2.0 and MySQL. I would like to enter text into several text boxes in a Web form, and submit the information to a database through a "Submit" button control. I...
4
by: Super Steve | last post by:
I'm trying to write a little script that disables the submit button on a form, changes the text of the button, and then submits the form. Can anyone tell me why this works ok: <input...
18
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the...
4
by: bleachie | last post by:
Hi, My e-mail form seems to work fine in IE7 but doesn't work in FireFox2.0 - it just goes to the index.php instead of echoing the completed message. Hope someone can help me out. Form.html...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.