#1 (permalink)  
Old 01-05-2006, 08:39 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
How do I add keyword to the javascripted url?

How do I add keyword to the javascripted url?
It's for the onchange and the iFrame. Once the dropdown is selected then the iFrame would show the verse.
I have an old code that looked like this:
Code:
location = "kjvresplistboxshowversea.id.options[document.myForm.id.selectedIndex].value + "&Keyword=" + document.myForm.Keyword.value + "&Keywordb=" + document.myForm.Keywordb.value + "&Keywordc=" + document.myForm.Keywordc.value + "&Keywordd=" + document.myForm.Keywordd.value + "&Keyworde=" + document.myForm.Keyworde.value + "&Keywordf=" + document.myForm.Keywordf.value + "#bcv
Code:
	<script language="JavaScript" type="text/javascript">
	<!--
		function go1()
		{
		booksa.action = "showversea.asp?id=";
		booksa.submit();
		}
	//-->
	</script>
	
		<form name="booksa" action="showversea.asp" method="get" target="ifrVerse">
		<select name="id" size="10" style="width:200;" onchange="go1();">
			
				<option  value="5276">Deuteronomy&nbsp;13:3</option>
				
				<option  value="8319">2 Samuel&nbsp;13:1</option>

				
				<option  value="8322">2 Samuel&nbsp;13:4</option>
				
				<option  value="8333">2 Samuel&nbsp;13:15</option>
				
				<option  value="12698">Nehemiah&nbsp;13:26</option>
				
				<option  value="16341">Psalms&nbsp;145:20</option>
				
				<option  value="16772">Proverbs&nbsp;13:24</option>

				
				<option  value="18774">Isaiah&nbsp;57:8</option>
				
				<option  value="26632">John&nbsp;13:1</option>
				
				<option  value="26654">John&nbsp;13:23</option>
				
				<option  value="26665">John&nbsp;13:34</option>
				
				<option  value="26666">John&nbsp;13:35</option>

				
				<option  value="28275">Romans&nbsp;13:8</option>
				
				<option  value="28276">Romans&nbsp;13:9</option>
				
				<option  value="28277">Romans&nbsp;13:10</option>
				
				<option  value="29055">2 Corinthians&nbsp;13:11</option>
				
				<option  value="29058">2 Corinthians&nbsp;13:14</option>

				
				<option  value="30243">Hebrews&nbsp;13:1</option>
				
		</select>
Reply With Quote

  #2 (permalink)  
Old 01-06-2006, 11:15 AM
Till's Avatar
Administrator
 
Join Date: Jan 2002
Location: Berlin, Germany
Posts: 1,453
Looks good, maybe you need to adjust form name and fields?
Reply With Quote
  #3 (permalink)  
Old 01-06-2006, 11:41 AM
Registered User
 
Join Date: Jul 2004
Posts: 249
how to add keyword to url

Ok but how do I add &keyword= in the url with the keyword searched for?
Reply With Quote
  #4 (permalink)  
Old 01-10-2006, 06:33 PM
Deadeye's Avatar
Moderator
 
Join Date: Aug 2005
Location: San Diego, CA
Posts: 274
Send a message via MSN to Deadeye
Code:
booksa.action = "showversea.asp?id=" + document.booksa.id.value
this should add the value of the selected box to the URL

Wesley
Reply With Quote
  #5 (permalink)  
Old 01-11-2006, 03:19 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
Quote:
Originally Posted by Deadeye
Code:
booksa.action = "showversea.asp?id=" + document.booksa.id.value
this should add the value of the selected box to the URL

Wesley
I don't have a problem with the id. It's the keyword that I don't understand. Please the read my posting well. I have to write things over and over to explain it!
Reply With Quote
  #6 (permalink)  
Old 01-13-2006, 12:20 PM
Deadeye's Avatar
Moderator
 
Join Date: Aug 2005
Location: San Diego, CA
Posts: 274
Send a message via MSN to Deadeye
I dont see what keyword your talking about. I am looking at the code but there is no mention besides the first code block of keywords.
Reply With Quote
  #7 (permalink)  
Old 01-19-2006, 03:39 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
I'm sorry. You're right. What I'm trying to get is how to write through javascript the keyword in the url.

Code:
	<script language="JavaScript" type="text/javascript">
	<!--
		var keyword
		keyword = "land rest"
		function go1(id)
		{
   		bookSelect.action = 'showversea.asp?id=' + id + '&keyword=' + keyword;
   		bookSelect.submit();
		}
	//-->
	</script>
And
Code:
		<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
		<select name="id" size="10" style="width:200;" onchange="go1();">
I wonder if and how
keyword = "land rest"
Should be
keyword = "land+rest"

THe error shows:
Line 24 object expected. Is this line 24 starting from the page source?

Last edited by gilgalbiblewhee; 01-19-2006 at 04:05 PM.
Reply With Quote
  #8 (permalink)  
Old 01-20-2006, 04:32 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
JS alert right but URL wrong

Ok Let me redirect my goal.
I have set an alert. It says:
Code:
http://127.0.0.1/showversea.asp?id=15418&keyword=brutish
But when the iFrame opens it writes only this in the URL.

Code:
 

http://127.0.0.1/wheelofgod/showversea.asp?id=15418
The second URL shows what the select name "id" is picking up "15418" from the option value. But it fails to pick up the "keyword" <%=Keyword%>. The page of dropdown is ASP-generated, in other words the ASP builds the dropdown from the result of the database table. Here is the section of the source:
Code:
	<script language="JavaScript" type="text/javascript">
	<!--
	function go1(identity,keyword)
        {
document.forms['bookSelect'].action = 'showversea.asp?id=' + identity + '&keyword='  + keyword 
               alert(bookSelect.action);
          bookSelect.submit();
        }
	//-->
	</script>
And
Code:
		
<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
<select name="id" size="10" style="width:200;" onchange="go1(document.forms['bookSelect'].id[document.forms['bookSelect'].id.selectedIndex].value,'brutish');">


			
				<option  value="14659">Psalms&nbsp;49:10</option>
				
				<option  value="15418">Psalms&nbsp;92:6</option>
				
				<option  value="15440">Psalms&nbsp;94:8</option>
				
				<option  value="16721">Proverbs&nbsp;12:1</option>
				
				<option  value="17254">Proverbs&nbsp;30:2</option>
				
				<option  value="18016">Isaiah&nbsp;19:11</option>
				
				<option  value="19210">Jeremiah&nbsp;10:8</option>

				
				<option  value="19216">Jeremiah&nbsp;10:14</option>
				
				<option  value="19223">Jeremiah&nbsp;10:21</option>
				
				<option  value="20230">Jeremiah&nbsp;51:17</option>
				
				<option  value="20976">Ezekiel&nbsp;21:31</option>
				
		</select>
Reply With Quote
  #9 (permalink)  
Old 01-20-2006, 06:29 PM
Registered User
 
Join Date: Jul 2004
Posts: 249
Ok Let me redirect my goal.
I just want to give an update if anyone is following this thread. I found the answer:

Code:
function go1(identity,keyword)
        {
url = 'showversea.asp?id=' + identity + '&keyword='  + keyword 
               //alert(bookSelect.action);
          //bookSelect.submit();
		  alert(url);
		ifrVerse.location = url;
        }
	//-->
The problem was this:
I have set an alert. It said:
Code:
http://127.0.0.1/showversea.asp?id=15418&keyword=brutish
But when the iFrame opens it writes only this in the URL.

Code:
 

http://127.0.0.1/wheelofgod/showversea.asp?id=15418
The second URL shows what the select name "id" is picking up "15418" from the option value. But it fails to pick up the "keyword" <%=Keyword%>. The page of dropdown is ASP-generated, in other words the ASP builds the dropdown from the result of the database table. Here is the section of the source:
Code:
	<script language="JavaScript" type="text/javascript">
	<!--
	function go1(identity,keyword)
        {
document.forms['bookSelect'].action = 'showversea.asp?id=' + identity + '&keyword='  + keyword 
               alert(bookSelect.action);
          bookSelect.submit();
        }
	//-->
	</script>
And
Code:
		
<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
<select name="id" size="10" style="width:200;" onchange="go1(document.forms['bookSelect'].id[document.forms['bookSelect'].id.selectedIndex].value,'brutish');">


			
				<option  value="14659">Psalms&nbsp;49:10</option>
				
				<option  value="15418">Psalms&nbsp;92:6</option>
				
				<option  value="15440">Psalms&nbsp;94:8</option>
				
				<option  value="16721">Proverbs&nbsp;12:1</option>
				
				<option  value="17254">Proverbs&nbsp;30:2</option>
				
				<option  value="18016">Isaiah&nbsp;19:11</option>
				
				<option  value="19210">Jeremiah&nbsp;10:8</option>

				
				<option  value="19216">Jeremiah&nbsp;10:14</option>
				
				<option  value="19223">Jeremiah&nbsp;10:21</option>
				
				<option  value="20230">Jeremiah&nbsp;51:17</option>
				
				<option  value="20976">Ezekiel&nbsp;21:31</option>
				
		</select>
To check it out use Internet Explorer:
http://i.domaindlx.com/wheelofgod/kj...s&optAction=on
Reply With Quote
  #10 (permalink)  
Old 01-23-2006, 12:18 PM
Deadeye's Avatar
Moderator
 
Join Date: Aug 2005
Location: San Diego, CA
Posts: 274
Send a message via MSN to Deadeye
http://forums.htmlcenter.com/showpos...97&postcount=4

The answer to this question should be the same as this post of mine.
Reply With Quote
Reply


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
Forum Jump


All times are GMT -5. The time now is 05:57 PM.

 
Bitrix
Clicky Web Analytics
CloudContacts
Maxtango


Subscribe to our feed | add to myYahoo!

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0
© 1997-2007 HTMLCenter