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

Post not working with AJAX

P: 4
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
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
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

Post your reply

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