Jump to content

Form Validation


seran128

Recommended Posts

I have a form that has some radio boxes in it. The user press a button and it send the form content to another site. I need to validate the foam data prior to sending to avaoid javascript errors. I would perfer to do this in the same function but if I have to split it up thats fine as well.

MY Function is

function sendform()
{
 
var oRad = document.MainForm.SELECT___FRMBB1___1;
    for(var i=0; i<oRad.length; i++) {       
if(oRad[i].checked) {           
position1=oRad[i].value;
        }
    }

var oRad1 = document.MainForm.SELECT___FRMBB1___29;
    for(var i=0; i<oRad1.length; i++) {       
if(oRad1[i].checked) {           
header1=oRad1[i].value;
        }
    }


var name1 = document.MainForm.TEXTBOX___91___FRMBB1___24.value;
var date1 = document.MainForm.TEXTBOX___95___FRMBB1___27.value;

var url="http://mtsite.com/index.php"
url=url+"?topheader="+header1
url=url+"&position="+position1
url=url+"&name="+name1
url=url+"&date="+date1

window.open(url);

   
}
Link to comment
https://forums.phpfreaks.com/topic/29751-form-validation/
Share on other sites

  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.