Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

On form submit, close fancybox and go to url

Posted on 2010-09-02
1
Medium Priority
?
1,486 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

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

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

705 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