If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Need ASP/Javascript to write URL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-06, 16:37
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
Need ASP/Javascript to write URL

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>
__________________
Compare bible texts (and other tools):
TheWheelofGod
Reply With Quote
  #2 (permalink)  
Old 01-22-06, 18:18
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
You don't have another function somewhere over riding the action do you??

Are you using the right action? I can never remember if post or get is the right one to use when you are doing this....
Reply With Quote
  #3 (permalink)  
Old 01-23-06, 00:23
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
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>
				
				
		</select>
To check it out use Internet Explorer:
http://i.domaindlx.com/wheelofgod/kj...s&optAction=on

I need to put that in the JavaScript with the '+' such as 'the cat ate the dog' as 'the+cat+ate+the+dog':

Code:
<script language="JavaScript" type="text/javascript">
	<!--
function go1(identity,keyword)
        {
url = 'showversea.asp?id=' + identity + '&keyword='  + keyword 
               //alert(bookSelect.action);
          //bookSelect.submit();
		  alert(url);
		ifrVerse.location = url;
        }

function go2(identity,keyword)
        {
url = 'showversea.asp?id=' + identity + '&keyword='  + keyword 
               //alert(bookSelect2.action);
          //bookSelect2.submit();
		  alert(url);
		ifrVerse2.location = url;
        }
	//-->
	</script>
Code:
<select name="id" size="10" style="width:200;" onchange="go1(document.forms['bookSelect'].id[document.forms['bookSelect'].id.selectedIndex].value,'<%=Keyword%>');">
__________________
Compare bible texts (and other tools):
TheWheelofGod
Reply With Quote
  #4 (permalink)  
Old 01-23-06, 00:32
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
You have changed your method of sending your data as well....

You are just setting a location and not using the submit (so request.querystring will work but request.form will not)

I suspect your real problem was that the method of your form is get not post... eg
Code:
<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
Code:
<form name="bookSelect" action="showversea.asp" method="post" target="ifrVerse">
Reply With Quote
  #5 (permalink)  
Old 01-23-06, 00:58
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
How is this related to post or get?
__________________
Compare bible texts (and other tools):
TheWheelofGod
Reply With Quote
  #6 (permalink)  
Old 01-23-06, 01:15
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
Actually,... maybe it's not,.. I can't remember, it has been ages... but...

One works on query strings, the other work on the form contents.

When you are working on the query strings I think it rebuilds the querystring when you submit. If you are using the other version you can effectively use both the querystring and the form contents....

With your problem you may have had a situation where you were changing the action, submitting and during the submit it was change the the url as well....

The javascript you were using looked right,.... *shrug* all academic anyways as you have your solution working
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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