Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
Joris van Lier #1
AJAX Submit Form
Anyone interested in an AJAX post form extension?
Anyone see caveats with the following script?
<script type="text/javascript">
function xmlhttppost(form){
var data ='';
var elems = form.getElementsByTagName('input');
for(var i=0;i<elems.length;i++){
var elem = elems[i];
switch(elem.type){
case "radio":
case "checkbox":
if(elem.checked){
if(data.length>0)data+='&';
data+=elem.name+'='+elem.value;
}
break;
case "text":
default:
if(data.length>0)data+='&';
data+=elem.name+'='+elem.value;
break;
}
}
elems = form.getElementsByTagName('textarea');
for(var i=0;i<elems.length;i++){
if(data.length>0)data+='&';
data+=elems[i].name+'='+elems[i].value;
}
elems = form.getElementsByTagName('select');
for(var i=0;i<elems.length;i++){
if(data.length>0)data+='&';
data+=elems[i].name+'='
var value = '';
for(var j=0; j<elems[i].options.length; j++){
if(elems[i].options[j].selected){
if(value.length>0)value+=',';
value+=elems[i].options[j].value;
}
}
data+=value;
}
if(form.method.toUpperCase()=='POST'){
req = new request();
req.onreadystatechange = xmlhttprequest_statuschange;
req.open( "POST", form.action, false );
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(data.replace(' ', '+'));
} else {
xmlhttprequest(form.action+'?'+data);
}
}
</script>
<form action="" name="theform" method="POST$"
onsubmit="xmlhttppost(this);return false;">
.....
Joris van Lier Guest
-
Submit PDF Form
I've created my first PDF Form in Acrobat 7.0 Professional, with a "submit-form" button. Now, I want the filled-out form to be sent as an attachment... -
Form does not submit in Mac
Hi all, I am using the submitForm() on my submit button. I have set the URL to "/Save.aspx" which will get the submitted information and doing... -
Form Field/ Form Submit Problems (probably an easy answer...)
Hey Everyone.. I have a form that has approximately 7 text fields and 1 checkbox. Generally when this form is submitted(to itself BTW) it works... -
ASP Form Doesn't Always Submit
Hello everyone, I am pretty much newbie to ASP so please bear with me as I explain my problem. I currently have a main form which displays data... -
form without submit
I have a form with a single menu element. How can I send the user's selection to the CF action page onChange without using Submit?



Reply With Quote

