/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Passing a value to the URL using JavaScript

Hi everyone,

This may be a stupid question, but I’m totally confused.. I’m currently passing the value from a combobox to my URL so I can use it to auto populate an IFRAME with another combobox. This works fine…

Now I also use the match() String JS Object in a conditional to see if certain values are in the combobox value string. If they are I set a variable to that value. I’m also trying to pass this value into the URL, but it seems when the IFrame Loads the variable is missing. Any Suggestions??

Here is my logic….

strTest = my comboBox value……
a = single quote…

[CODE]<script language=”JavaScript”>
function ParseObjType(strTest){
alert(strTest)

var ObjType
var ObjType2

var FactTable = “FCT”
var DimTable = “DIM”
var Cube = “OLAP”
var Crystal = “CR”
var Scheduler = “SCHD”
var Replication = “RPLC”
var MasterFile = “MF”
var Cenus = “CENS”
var Claims = “CLM”

if (strTest.match(FactTable)) {
ObjType = “FC”
alert(ObjType)
}
else if (strTest.match(DimTable)) {
ObjType = “DM”
alert(ObjType)
}
else if (strTest.match(Cube)) {
ObjType = “CB”
alert(ObjType)
}
else if (strTest.match(Crystal)) {
ObjType = “CR”
alert(ObjType)
}
else if (strTest.match(MasterFile)){
ObjType = “MF”
alert(ObjType)
}
else if (strTest.match(Cenus)) {
ObjType = “CE”
alert(ObjType)
}
else if (strTest.match(Claims)) {
ObjType = “CL”
alert(ObjType)
}
else{
ObjType = “RP”
ObjType2 = “SC”
alert(ObjType2)
alert(ObjType)
}

document.getElementById(“jobFrame”).src=(“iJobInfo.asp?Stream= ” + a + strTest + a + “&” + “objType = ” + a + ObjType + a)
}
</script> [/CODE]

I used the alert boxes and the Value gets stored correctly, however when the IFrame loads the value is not passed to through like the comboBox value..

Any help would be appreciated!!
Thanks,
Matt

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisFeb 13.2007 — document.getElementById("jobFrame").src=("iJobInfo.asp?Stream= " + a + strTest + a + "&" + "objType = " + a + ObjType + a)[/quote]Try getting rid of the spaces between "objTyp", "=" and the "+".document.getElementById("jobFrame").src=("iJobInfo.asp?Stream= " + a + strTest + a + "&amp;objType=" + a + ObjType + a)
Copy linkTweet thisAlerts:
@mattv10authorFeb 13.2007 — Thanks so much.. That is all I needed was someone else to look at the code.. I can't believe it was one space!! haha...

Thanks again
×

Success!

Help @mattv10 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 4.27,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

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