Solved

On form submit, close fancybox and go to url

Posted on 2010-09-02
1
1,456 Views
Last Modified: 2012-05-10
The form is loading as an iframe overlay using fancybox. Is there a way to close the module form and redirect the parent window to the thank you page?

I'm using jval to validate the page.

Thanks in advance!

form code below:

<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST" id="Avi1" onsubmit="if ( $('#Avi1').jVal() ) { return true; } else { return false; }" >
    <INPUT type="hidden" name="oid" value="xxxx">
    <INPUT type="hidden" name="sfga" value="xxxx">
    <input type=hidden name="retURL" value="/home/ContactThankYou">
    <div class="info">
      <h2>Get Started Today!</h2>
      <div></div>
    </div>
    <ul id="Avi">
      <li class="     " id="foli1">
        <label class="desc" id="title1" for="Field1"> Name </label>
        <span>
        <input id="first_name" name="first_name" type="text" class="field text fn" value="" size="8" tabindex="1" 	jVal="{valid:function (val) { if (val.length < 3) return 'Invalid Name'; else return ''; }}"					/>
        <label for="Field1">First<span class="req">*</span></label>
        </span> <span>
        <input id="last_name" name="last_name" type="text" class="field text ln" value="" size="14" tabindex="2" 	/>
        <label for="Field2">Last</label>
        </span> </li>
      <li id="foli10" class="     ">
        <label class="desc" id="title10" for="email;"> Email <span id="req_10" class="req">*</span> </label>
        <div class="col">
          <input id="email" name="email" type="text" class="field text medium" value="" maxlength="255" tabindex="3" 	
        	jVal="{valid:/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/, message:'Invalid Email Address'}"
					jValKey="{valid:/[a-zA-Z0-9._%+-@]/, cFunc:'alert', cArgs:['Email Address: '+$(this).val()]}"
        />
        </div>
      </li>
      <li id="foli13" class="     ">
        <label class="desc" id="company" for="Field13"> Company </label>
        <div class="col">
          <input id="Field13" name="company" type="text" class="field text medium" value="" maxlength="255" tabindex="4" onkeyup="" 
         	/>
        </div>
      </li>
      <li id="foli9" class="phone      ">
        <label class="desc" id="title9" for="Field9"> Phone Number </label>
        <span>
        <input id="Field9" name="areaCode" type="text" class="field text" value="" size="3" maxlength="3" tabindex="5" 	/>
        <label for="Field9">###</label>
        </span> <span class="symbol">-</span> <span>
        <input id="Field9-1" name="phoneNumber1" type="text" class="field text" value="" size="3" maxlength="3" tabindex="6" 	/>
        <label for="Field9-1">###</label>
        </span> <span class="symbol">-</span> <span>
        <input id="Field9-2" name="phoneNumber2" type="text" class="field text" value="" size="4" maxlength="4" tabindex="7" 	/>
        <label for="Field9-2">####</label>
        </span> </li>
      <li class="buttons ">
        <input id="saveForm" name="saveForm" class="btTxt submit" type="submit" value="Submit" 
        
		 onClick="if ( $('#Avi').jVal({style:'pod',padding:3,border:1,wrap:true}) ) ;"
        />
      </li>
      <li style="display:none">
        <label for="comment">Do Not Fill This Out</label>
        <textarea name="comment" id="comment" rows="1" cols="1"></textarea>
        <input type="hidden" id="idstamp" name="idstamp" value="" />
      </li>
    </ul>
  </form>

Open in new window

0
Comment
Question by:FuelUrMind
1 Comment
 

Accepted Solution

by:
FuelUrMind earned 0 total points
Comment Utility
Sometimes I over-complicate things, target="_parent" solves this.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now