Go Back   HTMLCenter Web Development Forums > Web Design and Development > Programming and Scripting
Connect with Facebook

Javascript problem in setting URL

Closed Thread
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 02-16-2006, 01:10 AM
Registered User
 
Join Date: Jul 2004
Posts: 249
Javascript problem in setting URL

Javascript problem in setting URL
I'm having difficulty in setting up the URL in by Javascript.
I have:
Code:
	<script language="JavaScript" type="text/javascript">
	<!--
function go1(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Keywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse').src='showversea.asp?id=' + document.bookSelect.id1.options[document.bookSelect.id1.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc   

	}
function go2(Keyword,Keywordc,Keywordb,Keywordd,Keyworde,Keywordf,Keywordg,Keywordh)
	{
	document.getElementById('ifrVerse2').src='showversea.asp?id=' + document.bookSelectb.id2.options[document.bookSelectb.id2.selectedIndex].value + '&keyword=' + Keyword.replace(/[ ]/g,'+') + '&keywordc=' + Keywordc
	}

	//-->
	</script>
This is the URL I get:
/showversea.asp?id=8654&keyword=8654&keywordc=king

As you see 8654 is written twice. And king is bumped over to &keywordc. It should be with &keyword.

I have 2 forms:
Code:
	<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
	<select name="id1" id="id1" size="10" style="width:200;" onchange="go1(document.getElementById('id1').value,'<%=Keyword%>','<%=Keywordc%>');">
and
Code:
	<form name="bookSelectb" action="showversea.asp" method="get" target="ifrVerse2">
	<select name="id2" id="id2" size="10" style="width:200;" onchange="go2(document.getElementById('id2').value,'<%=Keyword%>','<%=Keywordc%>');">
The iFrames I have no problem with but here they are:
Code:
<iframe
src ="/wheelofgod/kjvresplistbox.asp"
width="300" height="1200" name="ifrVerse" id="ifrVerse">
</iframe>

</td>
<td>
<iframe
src ="/wheelofgod/kjvresplistbox.asp"
width="300" height="1200" name="ifrVerse2" id="ifrVerse2">
</iframe>

  #2 (permalink)  
Old 03-07-2006, 01:25 PM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
Looks good - technically.

Did you try saving the values into variables first and then echoing them through a JavaScript alert() to see if they really contain what you expect them to contain?

Cheerz,
Till
  #3 (permalink)  
Old 03-07-2006, 02:34 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
problem solved

Code:
<select name="id2" id="id2" size="10" style="width:200;" onchange="go2(document.getElementById('id2').value,'<%=Keyword%>','<%=Keywordc%>');">
is now
Code:
<select name="id2" id="id2" size="10" style="width:200;" onchange="go2('<%=Keyword%>','<%=Keywordc%>');">
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with javascript - IE, Netscape and Firefox Tyree Programming and Scripting 8 05-15-2007 06:43 AM
Javascript parseInt() problem Deadeye Programming and Scripting 3 12-08-2006 07:42 AM
Trying to combine Slideshow javascript and transparent PNG files moez Programming and Scripting 0 01-23-2006 10:38 AM
Javascript Problem on My PC Lee Chaolan Programming and Scripting 1 08-22-2005 02:13 PM
Really lame Javascript form submission problem pillsbur Programming and Scripting 1 04-19-2005 11:13 AM


All times are GMT -5. The time now is 12:27 PM.

 
Clicky Web Analytics
CloudContacts
Loop11
Page.ly


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
© 1997-2009 HTMLCenter