/    Sign up×
Community /Pin to ProfileBookmark

Form onclick open in iFrame

Hello,

Sorry if this post may be a bit long.
There is going to be a bit of detail to give someone an idea what kind of help I am looking for. Thank you ahead for your patience.

I have a form on my site, after the information is added, then the submit image is clicked on, it goes to a secure site for the search. After, the results come back as a new page.
The form on the page is a standard form. My goal is, when you click on the image to submit the form to the other site; it opens in the iFrame named “main” with the results on my website. My thought, When you click on the submit image that it automatically sends the operation to the iFrame. I’m guessing that if it can be redirected to the iFrame before it starts the off site process, it will follow through with the process in the iFrame. I have tried adding onclick and onmousedown with the target being “main” and no go. I am usually fairly good at tweaking code, but this time I am completely stumped.
Any help in this situation would be great appreciated.
Again I apologize for the length of this post. I tried to get as much detail in as possible so there is not a thousand questions.

Take care,

G

Image submit code:

[CODE]<a href=”javascript:[COLOR=”Red”]redirectToDomainSearch[/COLOR]();”>
<img src=”images/arrow-do.png” alt=”” width=20 height=20 border=”0″ /></a>[/CODE]

Next: As you can see when the graphic is clicked on it calls the below script.

[CODE] <script type=”text/javascript”>
var veiTargetDiv = document.getElementById(‘ViewExtensionsInsertDiv’);
atlVeiInitializeEx(veiTargetDiv, ‘https://www.YadaYadaYada.net/’, ‘prog_id=12014’);

function OnDomainNameSearchInputKeyPressed(evt) {
if (evt && evt.charCode && evt.charCode == 13) {
redirectToDomainSearch();
cancelEventPropagation(evt);
}
}
function [COLOR=”Red”]redirectToDomainSearch[/COLOR]() {
var domainNamesTextBox = $get(‘ctl00_MainContent_ctl00_ctl00_Domain_Search_domainNames’);
var ddlTLDList = $get(‘ctl00_MainContent_ctl00_ctl00_Domain_Search_ddlTLDList’);
if (domainNamesTextBox != null && ddlTLDList != null) {
var domainToCheck = domainNamesTextBox.value;
var errorMessage = validateDomainSearchInput(domainToCheck);
if (errorMessage.length > 0) {
alert(errorMessage);
return ;
}

var selectedTLD = getSelectedValue(ddlTLDList);
if (selectedTLD) {
var url = ‘https://www.YadaYadaYada/search.asp?ci=13495&prog_id=1h25a06’;
if (url.indexOf(“?”) > 0)
url = url + “&”;
else
url = url + “?”;

location.href = url + ‘domainToCheck=’ + escape(domainToCheck) + ‘&tld=.’ + escape(selectedTLD) + ‘&checkAvail=1&ci=1h25a06’;
}
}
}
function getSelectedValue(ddl) {
var selectedValue = null;
for (i = 0; i < ddl.length; i++) {
if (i == ddl.selectedIndex) {
selectedValue = ddl.options[i].value;
break;
}
}
return selectedValue;
}
function cancelEventPropagation(evt) {
if (!evt) return false;
evt.returnValue = false;
evt.cancelBubble = true;
if (evt.stopPropagation) evt.stopPropagation();
if (evt.preventDefault) evt.preventDefault();
return false;
}
function validateDomainSearchInput(inputText) {
if (inputText.length == 0) {
return “Enter a domain name to search.”;
}
else {
var regExInvalidChars = /[^a-zA-Z0-9-s.]+/;
var isValid = regExInvalidChars.test(inputText);
if (isValid)
return “Invalid character in domain. Only letters, numbers or hyphens are allowed.”;
}
return “”;

}
</script> [/CODE]

The below code is also included, and is placed above the other script within the page:

[CODE] <script src=”https://www.YadaYadaYada.net/Asource.axd?d=WsnObeDq3PMcVgoVc9Ib3g2&amp;t=633505036635135091″ type=”text/javascript”></script>

<script src=”https://www.YadaYadaYada.net/Bsource.axd?d=lVzBafGP18mNCnBJk-JQx3w-G8V_WqgaC_JStyL9s9e3q-e2daYc0PA-g-D1XdsyQrAY01&amp;t=633505534525437426″ type=”text/javascript”></script>

<script src=”https://www.YadaYadaYada.net/Bsource.axd?d=lVzBdgsdGP18mNCnBJk-JQx3w-G8V_WqgaC_JStdgsg9e3q-e2daYc0PA-g-DdfgX2jhh-fFCgdceJkdfsghsdfgdjngsdguoTjAVdpHfyRc1&amp;t=6335050345745647626″ type=”text/javascript”></script>

<script src=”/https://www.YadaYadaYada.net/Shared/DynamicHtmlContent.asmx/js” type=”text/javascript”></script>

<script src=”https://www.YadaYadaYada.net/Asource.axd?d=3ndsdvsQKHBkbnzC_erkhly_kQg2&amp;t=633532456546335091″ type=”text/javascript”></script>

<script type=”text/javascript”>
//<![CDATA[
Sys.WebForms.PageRequestManager._initialize(‘ctl00$ScriptManager1’, document.getElementById(‘aspnetForm’));
Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);
//]]>
</script> [/CODE]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@G__EauthorJun 21.2009 — Still at it here and not making any headway. Anyone ?

Thanks
Copy linkTweet thisAlerts:
@G__EauthorJul 11.2009 — 272 views and no one? Well, For now the project has been shelved since this is the only thing hanging me up here. ?

Thanks for at least letting me post this here.
×

Success!

Help @G__E spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...