473,387 Members | 1,483 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,387 software developers and data experts.

Post not working with AJAX

I have been working on an XmlHTTPRequest for over a month and I have gotten this far:
Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2.  
  3. function OnStatus(){
  4. document.forms[0].ConditionSave.value = '1';
  5. document.forms[0].TaskEnable.checked = true;
  6.  
  7. var xmlhttp = new XMLHttpRequest();  
  8. xmlhttp.open("POST", "http://oneadvent.viewnetcam.com:50001/CgiImageTransfer", false);  
  9. xmlhttp.onreadystatechange = function() {
  10.     if (xmlhttp.readyState == 4) {
  11.         // Your callback code goes here
  12.     }
  13. }
  14. // set headers and mime-type appropriately  
  15.  
  16. xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
  17.  
  18. xmlhttp.send('Language=' + document.getElementById(Language).value + '&Page=' + document.getElementById(Page).value + '&TaskId=' + document.getElementById(TaskId).value + '&MessageMode=' + document.getElementById(MessageMode).value + '&PrimaryStartSun=' + document.getElementById(PrimaryStartSun).value + '&PrimaryStartMon=' + document.getElementById(PrimaryStartMon).value + '&PrimaryStartTue=' + document.getElementById(PrimaryStartTue).value + '&PrimaryStartWed=' + document.getElementById(PrimaryStartWed).value + '&PrimaryStartThu=' + document.getElementById(PrimaryStartThu).value + '&PrimaryStartFri=' + document.getElementById(PrimaryStartFri).value + '&PrimaryStartSat=' + document.getElementById(PrimaryStartSat).value + '&PrimaryTimeMode=' + document.getElementById(PrimaryTimeMode).value + '&PrimaryStartAMPM=' + document.getElementById(PrimaryStartAMPM).value + '&PrimaryStartHour=' + document.getElementById(PrimaryStartHour).value + '&PrimaryStartMin=' + document.getElementById(PrimaryStartMin.value + '&PrimaryStopAMPM=' + document.getElementById(PrimaryStopAMPM).value + '&PrimaryStopHour=' + document.getElementById(PrimaryStopHour).value + '&PrimaryStopMin=' + document.getElementById(PrimaryStopMin).value + '&PrimaryResolution=' + document.getElementById(PrimaryResolution).value + '&PrimaryQuality=' + document.getElementById(PrimaryQuality).value + '&PrimaryPreIntervalNum=' + document.getElementById(PrimaryPreIntervalNum).value + '&PrimaryPreIntervalPer=' + cument.getElementById(PrimaryPreIntervalPer).value + '&PrimaryPreNum=' + document.getElementById(PrimaryPreNum).value + '&PrimaryPreEnable=' + document.getElementById(PrimaryPreEnable).value + '&PrimaryPostNum=' + document.getElementById(PrimaryPostNum).value + '&PrimaryPostEnable=' + document.getElementById(PrimaryPostEnable).value + '&SensorIgnoreTime=' + document.getElementById(SensorIgnoreTime).value + '&PrimaryPostIntervalNum=' + document.getElementById(PrimaryPostIntervalNum).value + '&PrimaryPostIntervalPer=' + document.getElementById(PrimaryPostIntervalPer).value + '&TransferMode=' + document.getElementById(TransferMode).value + '&TransferMailServer=' + document.getElementById(TransferMailServer).value + '&TransferSMTPPortNo=' + document.getElementById(TransferSMTPPortNo).value + '&TransferPopServer=' + document.getElementById(TransferPopServer).value + '&TransferAuth=' + document.getElementById(TransferAuth).value + '&TransferPOP3PortNo=' + document.getElementById(TransferPOP3PortNo).value + '&TransferPopID=' + document.getElementById(TransferPopID).value + '&TransferSMTPID=' + document.getElementById(TransferSMTPID).value + '&TransferPopPassword=' + document.getElementById(TransferPopPassword).value + '&TransferSMTPPassword=' + document.getElementById(TransferSMTPPassword).value + '&TransferMailFrom=' + document.getElementById(TransferMailFrom).value + '&TransferMailTo1=' + document.getElementById(TransferMailTo1).value + '&TransferMailTo2=' + document.getElementById(TransferMailTo2).value + '&TransferMailTo3=' + document.getElementById(TransferMailTo3).value + '&TransferMailSubject=' + document.getElementById(TransferMailSubject).value + '&TransferMailText=' + document.getElementById(TransferMailText).value + '&Position=' + document.getElementById(Position).value + '&MessageMode=' + document.getElementById(MessageMode).value + '&MessageMailServer=' + document.getElementById(MessageMailServer).value + '&MessageSMTPPortNo=' + document.getElementById(MessageSMTPPortNo).value + '&MessagePopServer=' + document.getElementById(MessagePopServer).value + '&MessageAuth=' + document.getElementById(MessageAuth).value + '&MessagePOP3PortNo=' + document.getElementById(MessagePOP3PortNo).value + '&MessagePopID=' + document.getElementById(MessagePopID).value + '&MessageSMTPID=' + document.getElementById(MessageSMTPID).value + '&MessagePopPassword=' + document.getElementById(MessagePopPassword).value + '&MessageSMTPPassword=' + document.getElementById(MessageSMTPPassword).value + '&MessageMailFrom=' + document.getElementById(MessageMailFrom).value + '&MessageMailTo1=' + document.getElementById(MessageMailTo1).value + '&MessageMailTo2=' + document.getElementById(MessageMailTo2).value + '&MessageMailTo3=' + document.getElementById(MessageMailTo3).value + '&MessageMailSubject=' + document.getElementById(MessageMailSubject).value + '&MessageMailText=' + document.getElementById(MessageMailText).value + '&ClearImage=' + document.getElementById(ClearImage).value + '&ConditionSave=' + document.getElementById(ConditionSave).value + '&TransCondition=' + document.getElementById(TransCondition).value + '&TaskEnable=' + document.getElementById(TaskEnable).checked);
  19.  
  20. }
  21.  
  22. function OffStatus(){
  23. document.forms[0].ConditionSave.value = '1';
  24. document.forms[0].TaskEnable.checked = false;
  25. document.forms[0].submit();
  26. }
  27.  
  28. </script>
  29.  
can someone please tell me what I am doing wrong
Nov 1 '08 #1
1 1385
acoder
16,027 Expert Mod 8TB
First of all, what do you mean by not working? What does it do or not do?

I notice a few problems, but it would help if you give more details including any errors. See a simple example.
Nov 1 '08 #2

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

Similar topics

1
by: protocolhttp | last post by:
hi, iam a newbie and currently working on a project based on javascript and ajax, I am stuck and i have trying to get out of it but with no success,,, Hoping that u’ll help
1
by: pritisolank | last post by:
Hello Everyone, With that alert statment alert("calling validateme for "+document.form1.elements); in js things would work fine but if i remoe the form is simply getting submitted in firebug i can...
3
by: nuchphasu | last post by:
Hi I have a problem on Dropdownlist that connect database and retrieve data by Ajax.I write javascript like this -------------------------------------------------------------------------...
14
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code>...
2
by: lggarrison | last post by:
I am brand new to .NET and I'm maintaining a website written in C# / .NET. Basically, I'm modifying some AJAX to send a press release through POST instead of GET because of the size limitations...
6
by: =?Utf-8?B?U2hhd24gU2VzbmE=?= | last post by:
Greetings! I was researching AJAX to provide a solution to displaying status messages while a long process executed. I found several examples online and was able to use their code to get a quick...
10
by: Peter Michaux | last post by:
Hi, All Ajax libraries I've read use encodeURIComponent() on the name- value pairs extracted from forms before POST ing the result to the server with and xmlhttprequest. I can understand why...
2
by: KBS Tours Development | last post by:
Hi, I've deployed latest release on production with new AJAX functionality but the server posts back completely and toolkit functionalities are not working at all like calendar etc. Here is...
3
sunbin
by: sunbin | last post by:
Hi, I am having in a Trouble when working with dynamic checkboxes (i.e. checkboxes with the same name, e.g. <input type="checkbox" name = "check" value="dynamic integer value">) I have...
1
by: Mark B | last post by:
This is my first try at using AJAX. I want the calendars to be enabled if the user checks CheckBox1. It works OK for a normal all page refresh but once I introduced the AJAX code it stopped...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.