troubleshooting Question

Submit a form cross domain without the use of an iframe

Avatar of error77
error77 asked on
HTMLJavaScriptPHP
20 Comments2 Solutions5016 ViewsLast Modified:
Hi all,

I was given an iframe to add to my website which points to an online form.

Now, for seo reasons I do not want to use the iframe so I copied the form html into a new html page and then pointed the form action to the domain url which holds the online form. This not working, so can anyone help?

Here is the code for the online form:

<!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=UTF-8" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'>
<script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.8.3'></script>
<script type='text/javascript' src='js/if-val.js'></script>
<link href="css/iframe.css" rel="stylesheet" type='text/css'>
<title>Could you Claim?</title>
</head>
<body >

<div class="header">
	<div id="claimheader">
		<h1>Claim Form</h1>
		<p>Please fill in the claim form below and a member of our team will get back to you as soon as possible.</p>
	</div>
	<div id="aahlogo">
		<img src="img/aah-logo.jpg"/>
	</div>
	<div class="clear"><!-- --></div>
</div>
	
<form id="claimform" method="post" action="" onsubmit="return submitformone();">

<div id="formleft">
	<h2>1. About your Accident</h2>
	<div class="questionblock top">
		<div class="question">Were you injured in the last 3 years?</div>
		<div class="questionopts">
			<input id="radTimeYes" type="radio" name="Time" value="True" checked="checked" /><label class="radio-l" for="radTimeYes">YES</label>
			<input id="radTimeNo" type="radio" name="Time" value="False" /><label class="radio-r" for="radTimeNo">NO</label>
		</div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question">Was the accident your fault?</div>
		<div class="questionopts">
			<input id="radFaultYes" type="radio" name="Fault" value="True" /><label class="radio-l" for="radFaultYes">YES</label>
			<input id="radFaultNo" type="radio" name="Fault" value="False" checked="checked" /><label class="radio-r" for="radFaultNo">NO</label>
		</div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question">Did you receive medical attention?</div>
		<div class="questionopts">
			<input id="radMedicalYes" type="radio" name="MedicalAtt" value="True" checked="checked" /><label class="radio-l" for="radMedicalYes">YES</label>
			<input id="radMedicalNo" type="radio" name="MedicalAtt" value="False" /><label class="radio-r" for="radMedicalNo">NO</label>
		</div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock injury">
		<div class="question">Where was your injury?</div>
		<div class="questionopts whereinjured">
			<div><input type="checkbox" name="chkHead" id="chkHead" value="Head"/><label for="chkHead">Head</label></div>
			<div><input type="checkbox" name="chkArm" id="chkArm" value="Arm"><label for="chkArm">Arm</label></div>
			<div><input type="checkbox" name="chkPelvis" id="chkPelvis" value="Pelvis"><label for="chkPelvis">Pelvis/Hip</label></div>
			<div class="breakthree"><input type="checkbox" name="chkNeck" id="chkNeck" value="Neck"><label for="chkNeck">Neck</label></div>
			<div class="breakfour"><input type="checkbox" name="chkElbow" id="chkElbow" value="Elbow"><label for="chkElbow">Elbow</label></div>
			<div><input type="checkbox" name="chkKnee" id="chkKnee" value="Knee"><label for="chkKnee">Knee</label></div>
			<div class="breakthree"><input type="checkbox" name="chkBack" id="chkBack" value="Back"><label for="chkBack">Back</label></div>
			<div><input type="checkbox" name="chkWrist" id="chkWrist" value="Wrist"><label for="chkWrist">Wrist</label></div>
			<div class="breakfour"><input type="checkbox" name="chkLeg" id="chkLeg" value="Leg"><label for="chkLeg">Leg</label></div>
			<div class="breakthree"><input type="checkbox" name="chkShoulder" id="chkShoulder" value="Shoulder"><label for="chkShoulder">Shoulder</label></div>
			<div><input type="checkbox" name="chkHand" id="chkHand" value="Hand"><label for="chkHand">Hand</label></div>
			<div><input type="checkbox" name="chkAnkle" id="chkAnkle" value="Ankle"><label for="chkAnkle">Foot</label></div>
		</div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="briefdetails">
		<div class="question long">
			Brief details of your injury</span><br/>
			<textarea rows="7" cols="20" name="frmtxtInjuryDetails" id="frmtxtInjuryDetails"></textarea>
		</div>
	</div>
</div>

<div id="formright">
	<h2>2. Your Details</h2>
	<div class="questionblock top">
		<div class="question"><label>Your Title<span>*</span></label></div>
		<div class="questionopts">
			<select name="frmdrpTitle" id="frmdrpTitle">
				<option value="">Please Select</option>
				<option value="Mr">Mr</option>
				<option value="Mrs">Mrs</option>
				<option value="Ms">Ms</option>
				<option value="Miss">Miss</option>
				<option value="Prof">Prof</option>
				<option value="Dr">Dr</option>
				<option value="Rev">Rev</option>
			</select>
		</div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question"><label>First Name<span>*</span></label></div>
		<div class="questionopts"><input name="frmtxtFirstName" type="text" maxlength="50" id="frmtxtFirstName"/></div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question"><label>Surname<span>*</span></label></div>
		<div class="questionopts"><input name="frmtxtSurName" type="text" maxlength="50" id="frmtxtSurName"/></div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question"><label>Home Phone<span>*</span></label></div>
		<div class="questionopts"><input name="frmtxtHomePhone" type="text" maxlength="20" id="frmtxtHomePhone"/></div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question"><label>Alternative Phone<span>*</span></label></div>
		<div class="questionopts"><input name="frmtxtAltPhone" type="text" maxlength="20" id="frmtxtAltPhone"/></div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock">
		<div class="question"><label>Email Address</label></div>
		<div class="questionopts"><input name="frmtxtEmail" type="text" id="frmtxtEmail"/></div>
		<div class="clear"><!-- --></div>
	</div>
	<div class="questionblock startclaim">
		<div class="submitbtn">
			<input type="submit" value="Start Claim" name="btnSubmit" id="btnSubmit"/>
			<input type="hidden" name="hidSR" id="hidSR" value="" />
			<input type="hidden" name="hidRef" id="hidRef" value="" />
			<input type="hidden" name="hidUA" id="hidUA" value="Mozilla/5.0 (Windows NT 6.1; WOW64; rv:32.0) Gecko/20100101 Firefox/32.0" />
			<input type="hidden" name="hidS" id="hidS" value="inviveseo" />
		</div>
		<div class="errors">
			<p id="frmreqvaldrpTitle" class="cfrequired"><b>Title</b> is required</p>
			<p id="frmreqvalFirstName" class="cfrequired"><b>First Name</b> is required</p>
			<p id="frmregvalFirstName" class="cfrequired"><b>First Name</b> is invalid</p>
			<p id="frmreqvalSurName" class="cfrequired"><b>Surname</b> is required</p>
			<p id="frmregvalSurName" class="cfrequired"><b>Surname</b> is invalid</p>
			<p id="frmreqvalHomePhone" class="cfrequired"><b>Home Phone Number</b> is required</p>
			<p id="frmcusvalHomePhone" class="cfrequired"></p>
			<p id="frmreqvalAltPhone" class="cfrequired"><b>Alternative Phone Number</b> is required</p>
			<p id="frmcusvalAltPhone" class="cfrequired"></p>
		</div>
		<div class="footer">
		
		</div>
	</div>	
</div>
</form>
<div class="clear"><!-- --></div>
</body>
</html>

Please let me know if you need anything else.

I just need a way to submit it cross domain.

Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 20 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 20 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros