/    Sign up×
Community /Pin to ProfileBookmark

Running java on parent page with simultaneous script running in iFrame

Greetings,

I am completely new to javascript and need some help.
I have a script (which works fine) for a duty roster which searches a database table and returns a weekly schedule for the selected tech. Now there is a new table (extra duties) which I have showing in a iFrame on the same page as the first table. The problem is that I don’t know how to run the same search/script in the iFrame to show the same results so the tech’s can see both schedules together. Both tables reside in the same domain.

The script is as follows (I have included only one week out of the year for the example):

<select id=”tech”>
<option value=”gadabout”>Al Bell</option>
<option value=”mundy”>Matt Undy</option>
<option value=”kstupple”>Kyle Stupple</option>
<option value=”sperrin”>Steve Perrin</option>
<option value=”sdlamb”>Steve Lambert</option>
</select>
<select id=”startDate”>
<option value=”&comparisonType1=is+greater+than+or+equal+to&value1=05%252F04%252F2009&joinCondition2=AND&column2=startdate&comparisonType2=is+less+than+or+equal+to&value2=05%252F10%252F2009″>Week May 04 – May 10</option>
</select>

<script language=”javascript”>
function doSearch() {
var theTechname = document.getElementById(‘tech’).value;

var theWeek = document.getElementById(‘startDate’).value;

theSearchURL = “/<Webobject name=DataAccess_SiteID></WebObject>/<Webobject name=DataAccess_SectionName></WebObject>&column0=uniquename3&comparisonType0=is+equal+to&value0=” + theTechname + “&joinCondition1=AND&column1=startdate” + theWeek;
document.location.href = theSearchURL;
//alert(theSearchURL);
}
</script>

Any advice or example scripts would be greatly appreciated.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51May 08.2009 — Problem is you can not set it with JavaScript, you would need your serverside framework to set the iframe's url with the data. [Also Java != JavaScript]

Eric
Copy linkTweet thisAlerts:
@steveLauthorMay 08.2009 — Isn't there any way to pass the search variables from the main search to the iFrame or load the same search criteria on the iframe page so that when the parent page refreshes with the search results, the iframe refreshes with the same results?
Copy linkTweet thisAlerts:
@A1ien51May 08.2009 — basic idea of reading the querystring values and setting the iframe source on the page load.

[CODE]window.onload = function(){
document.getElementById("iframeId").src = "http://example.com" + window.location.search;
}
[/CODE]


Eric
×

Success!

Help @steveL 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...