Solved

On form submit, close fancybox and go to url

Posted on 2010-09-02
1
1,473 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trying to use &NBSP to line up 3 rows 12 40
Error Handler 8 43
display data from multiple ajax calls 9 43
How to change normal array form to associative in javascript 1 24
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article discusses how to create an extensible mechanism for linked drop downs.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

751 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