I'd like someone to just give me a hand getting a form to open up facebox and submit the form details via that.

Ok they process I'm looking for help on is this

When a user enters the details into the contact form and clicks "submit" it needs to then open up a facebox window and run the php file in that.
so it will either pop up and say errors with certain feilds or message sent.
Right now I can't seem to figure it out so i stripped the facebox code out and put my html code back to normal.

I', not too fussed weather the php file opens from a remote file or if it is stored in a hidden Div on the page its self.

<!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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<form id="contactForm" action="validator.php" method="post">		
				<div id="OrcFormContentLeft">					
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderName">Name*</label></li>
						<li><input type="text" name="senderName" id="senderName"   required/></li>
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderEmail">Email*</label></li>
						<li><input type="text" name="senderEmail" id="senderEmail" required /></li>
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderPhone">Phone Number</label></li>
						<li><input type="text" name="senderPhone" id="senderPhone"  /></li>				
				<div id="OrcFormContentRight">
                    	<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderBudget">Monthly SEO Budget*</label></li>
						<li><select name="senderBudget" id="senderBudget"  required/>
                  			 <option value="£0 - £99">£0 - £99</option>
 							 <option value="£100 - £199">£100 - £199</option>
 							 <option value="£200 - £299">£200 - £299</option>
 							 <option value="£300 - £399">£300 - £399</option>
                             <option value="£400 - £499">£400 - £499</option>
                             <option value="£500 - £599">£500 - £599</option>
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="message" style="padding-top: .5em;">Comments*</label></li>
						<li><textarea name="message" id="message" cols="10" rows="4" maxlength="10000" required></textarea></li>	
				<div id="clear"></div>
				<div id="formButtons">	

			<input type="submit" id="sendMesdsage" value="sendMessage" name="sendMessage"/>

Thankyou for your help in advance :)

6 Years
Discussion Span
Last Post by Airshow
... then open up a facebox window and run the php file in that.

I think you will find that a facebox "window" is not independent of the window in which it is opened. ie. you can't "run the php file" in it. Therefore not possible in the way you describe.

However, you should be able to achieve what you want by calling your php script with an AJAX (Google it and/or search Daniweb) request, then handling the response in a way that is compatible with facebox.

All you need to do is learn AJAX (or jQuery) and study the facebox documentation.


Edited by Airshow: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.