I'll give that a try. Thank you so much!
2 2006-12-15 22:42
Re: Submit Form (9 replies, posted in Programming)
So the query string can be as long as it wants, but it's limited by the number of variables in it?
3 2006-12-15 22:35
Re: Submit Form (9 replies, posted in Programming)
Well the thing is, if I set the form to submit regularly (meaning, without AJAX--actually navigate to the page) it all works fine. However, if I don't, then it comes back saying one of the variables in my query string is undefined.
4 2006-12-14 21:01
Re: Submit Form (9 replies, posted in Programming)
The problem is, I believe I am maxing out the query string length. Is there a way to get around this?
5 2006-12-06 00:39
Topic: Submit Form (9 replies, posted in Programming)
I'm trying to create an AJAX function that submits a form. So far, what I have it doing, is compiling all the form data into a string and submitting that. However, I think its maxing out the querystring.
Is there a way to submit the entire form through AJAX without sending it through the querystring?
//Global variables
var http = null;
//Create request
function ajaxCreateRequestObject() {
//Basic variable
var req;
//Check for browser compatibility
//Firefox, safari, opera...
if(window.XMLHttpRequest)
req = new XMLHttpRequest();
//IE v5+
else if(window.ActiveXObject)
req = new ActiveXObject("Microsoft.XMLHTTP");
//No compatibility
else
alert('Problem creating the XMLHttpRequest object.');
//Return the function
return req;
}
//Send request
function ajaxSendRequest(method, url, handler, parameters)
{
//Open up and send request
http.open(method, url, true);
http.onreadystatechange = handler;
http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
http.send(parameters);
}
function adminProfileNewSubmit()
{
//Get the form elements
var Title=document.getElementById('adminFormProfileNewTitle').value;
var Body=document.getElementById('adminFormProfileNewDesc').value;
var Annc=document.getElementById('adminFormProfileNewAnn').value;
var Url=document.getElementById('adminFormProfileNewUrl').value;
var Guest=document.getElementById('adminFormProfileNewGuest').value;
var User=document.getElementById('adminFormProfileNewUser').value;
var Skin=document.getElementById('adminFormProfileNewSkin').value;
var Def=document.getElementById('adminFormProfileNewDefault').value;
//Validate form
statusbarUpdate('Validatin...',true);
if(adminProfileFormVerify() == false)
{
//Update status
statusbarUpdate('Submitting...',true);
//Prepare parameters
var data = 'Title='+escape(Title)+'&Body='+escape(Body)+'&Annc='+escape(Annc)+'&Url='+escape(Url)+'&Guest='+Guest+'User='+User+'&Skin='+escape(Skin)+'&Default='+Def+'';
var buttons = new Array( ['Okay', 'modalDeactivate()', 'modalBoxButtonYes'] );
modalInitiate('AdminResults', 'Success!', data, buttons, 300);
//Create and send request
http = ajaxCreateRequestObject();
ajaxSendRequest('POST','AJAX/adminBoard.asp?Action=3', adminProfileNewSubmitHandler, data);
}else
statusbarHide();
}
function adminProfileNewSubmitHandler()
{
//Finished request
if(http.readyState == 4 && http.status == 200)
{
//Get response text
var response = http.responseText;
//Check for success
if(response.indexOf('1')!=-1)
{
//Update content
adminContentShowpage('adminBoard.asp','1')
//Alert user to success
var buttons = new Array( ['Okay', 'modalDeactivate()', 'modalBoxButtonYes'] );
modalInitiate('AdminResults', 'Success!', 'The new profile has been created successfully.', buttons, 300);
}else
{
//Alert
var buttons = new Array( ['Okay', 'modalDeactivate()', 'modalBoxButtonYes'] );
modalInitiate('AdminResults', 'Error!', 'There was an unknown error creating new profile.', buttons, 300);
}
//Hide statusbar
statusbarUpdate('Loading...',false);
}else if(http.readyState == 4 && http.status != 200)
statusbarUpdate('Error with remote page.', true);
}
Anybody have any ideas? I'd really appreciate the help.
6 2005-12-18 01:36
Re: Word Association Thread (1,382 replies, posted in General discussion)
Madison
7 2005-12-13 22:47
Re: View and Replies? (3 replies, posted in PunBB 1.2 bug reports)
I'm sorry? I'm not sure what you mean by that .
8 2005-12-13 21:13
Topic: View and Replies? (3 replies, posted in PunBB 1.2 bug reports)
This isn't really a bug on my own PunBB Forums, its just something I have noticed here on the main forums...
Whenever a topic appears to be moved, the "Views" and "Replies" for that topic appear to be blank. I don't know the reason behind it, but has anyone else noticed this too? I don't see why they should be stripped of the topic simply because it was moved... I would still be interested in seeing that information, if it was done on purpose?
Just a thought...
[Edit] Also, the last post. That doesn't come up either.
9 2005-12-11 17:13
Re: AJAX post preview 1.0.1 (11 replies, posted in PunBB 1.2 modifications, plugins and integrations)
[Again] Demo? I would like to see it working before I try to install it... I must say I am very interested.
10 2005-12-11 17:11
Re: Word Association Thread (1,382 replies, posted in General discussion)
different
11 2005-12-10 18:28
Re: [HTML/Javascript] DIV does not appear where it should (2 replies, posted in Programming)
Hmm. I found that to be very helpful, but I can't get it to work. The X and Y parts don't work when I tried. Would you mine taking my script (below) and seeing if you can get any of it to work in your own way? I'd really appreciate it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="Javascript">
<!--
var hideContext=0;
function showMenu(menu,el,pos)
{
el = document.getElementById(el);
div = document.getElementById(menu);
//Point of the elements left corner, plus width = right corner
//We want the right edge of the popup to align to the right corner
//So, get the point of the right corner - the width of the menu
//And you get the point of the left corner for the div when alligned
var point = getLeft(el) + el.offsetWidth;
point = point - div.width;
//To make it under the link, the top + height gives you the bottom
var top = el.top + el.height;
with(div)
{
//Move to below item
style.top=getTop(el) + 'px';
//Position depending on align left or right
if(pos == 1)
style.left=getLeft(el) + 'px';
else if(pos == 2)
style.left=point + 'px';
//Display
style.visibility='visible';
}
clearTimeout(hideContext);
}
function getLeft(eElement)
{
var nLeftPos = eElement.offsetLeft; // initialize var to store calculations
var eParElement = eElement.offsetParent; // identify first offset parent element
while (eParElement != null)
{ // move up through element hierarchy
nLeftPos += eParElement.offsetLeft; // appending left offset of each parent
eParElement = eParElement.offsetParent; // until no more offset parents exist
}
return nLeftPos; // return the number calculated
}
function getTop(element)
{
var topPos = 0;
//For IE and others
if(element.offsetParent)
{
while(element)
{
topPos+=element.offsetTop;
element=element.offsetParent;
}
}
//For netscape
else if(element.y)
topPos=element.y;
//Return value
return topPos;
}
function hide(menu)
{
document.getElementById(menu).style.visibility='hidden';
}
//-->
</SCRIPT>
<STYLE>
.Popup
{
position: absolute;
visibility: hidden;
background-color: #FFFFFF;
color: #000000;
border: 1px solid #000000;
padding: 3px;
width: 75px;
}
</STYLE>
</head>
<body>
<DIV align="right">Post #1 | <A id="MenuLink1" href="javascript:void(false)" onClick="showMenu('PostMenu1','MenuLink1','2')">Options</A></DIV>
<!-- POPUP MENU -->
<DIV id="PostMenu1" class="Popup">
<A href="PostEdit.asp?ForumID=2">Edit</A><BR>
<A href="PostDelete.asp?ForumID=2">Delete</A><BR>
<A href="javascript:void(hide('PostMenu1'))">Close</A>
</DIV>
<DIV align="right">Post #2 | <A id="MenuLink2" href="javascript:void(false)" onClick="showMenu('PostMenu2','MenuLink2','2')">Options</A></DIV>
<!-- POPUP MENU -->
<DIV id="PostMenu2" class="Popup">
<A href="PostEdit.asp?ForumID=2">Edit</A><BR>
<A href="PostDelete.asp?ForumID=2">Delete</A><BR>
<A href="javascript:void(hide('PostMenu2'))">Close</A>
</DIV>
</body>
</html>
12 2005-12-03 03:09
Topic: [HTML/Javascript] DIV does not appear where it should (2 replies, posted in Programming)
I am coding the latest versions of my forums, and I am trying to implement pop-up menu's using a simple Javascript code that call's a DIV layer with the menu options already in it, to the link that calls the menu. The javascript is as follows:
<script language="Javascript">
var hideContext=0;
function showMenu(menu,el,position)
{
el = document.getElementById(el);
div = document.getElementById(menu);
//Point of the elements left corner, plus width = right corner
//We want the right edge of the popup to align to the right corner
//So, get the point of the right corner - the width of the menu
//And you get the point of the left corner for the div when alligned
var point = el.offsetLeft + el.offsetWidth;
point = point - div.offsetWidth;
with(document.getElementById(menu))
{
//Move to below item
style.top=el.offsetTop + el.offsetHeight;
//Position depending on align left or right
if(position==1)
style.left=el.offsetLeft;
else if(position==2)
style.left=point;
//Display
style.visibility='visible';
}
clearTimeout(hideContext);
}
function hide(menu)
{
document.getElementById(menu).style.visibility='hidden';
}
</SCRIPT>
The link that calls the menu:
<DIV align="right">Post #1 | <A id="MenuLink1" href="javascript:void(false)" onClick="showMenu('PostMenu1',this.id,2)">Options</A></DIV>
<!-- POPUP MENU -->
<DIV id="PostMenu1" class="Popup">
<A href="PostEdit.asp?ForumID=3&ThreadID=1&PostID=1">Edit</A><BR>
<A href="PostDelete.asp?ForumID=3&ThreadID=1&PostID=1">Delete</A><BR>
<A href="javascript:void(hide('PostMenu1'))">Close</A>
</DIV>
In internet explorer the menu pops-up at the top of the page, not even aligned horizontally as it should. In Firefox, the menu pops-up under the link as it should, but it appears to the left of the page, not aligned with the right side of the link as it should. Any ideas?
Thanks.