Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need help passing a submited value from a form without javascript

Status
Not open for further replies.

soas

Technical User
Aug 3, 2001
49
US
Okay normally this would be simple just use javascript
I need to pass a value from a site that cant use (the server wont let you put it) javascript to a site that can...

this is what I have on the page that cant use javascript

<form action=&quot; method=&quot;post&quot; target=&quot;new&quot;>
<input type=&quot;text&quot; name=&quot;name&quot;>
<input type=&quot;submit&quot; value=&quot;Enter Name&quot;>
</form>

now.. the page that it opens when you click the button can use java script.. Is there any way to pass the value of the text box to action.htm where I can display it via javascript..
It works with php documents fairly easily.. so I assume it would work just as well with javascript.. I cant use php on either of the sites hehe..

Well if anyone knows how I can do this or if its not possible please tell me, I would really appreciate it..
If I am being too confusing about what I want to accomplish, please feel free to ask for more explaination..
Thanks!
 
The only way to be able to write the info to the screen on the 2nd page is through server side scripting. Javascript is normally client side. Once the form is submitted use your php, asp, coldfusion to pick up the form subimmision, write it to variables and display it on the screen. DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
But if he uses &quot;get&quot; method instead of &quot;post&quot; then the form data will be available on the QueryString (appended to the current URL), so why can't he use client-side JavaScript tp pick it up from there? ---
---
 
Would you mind explaining how to do that Rydel?
Thats how Im trying to get it to work..
 
Like Rydel said, if you use GET instead of POST you can do a JavaScript request :

<script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>
var request = new Object();
myname = request.name
</script>

Hello <script language=&quot;JavaScript&quot; type=&quot;text/JavaScript&quot;>document.write(myname)</script> welcome to my site Regards

Big Dave

davidbyng@hotmail.com


** If I am wrong I am sorry, but i'm only trying to help!! **

 
Hi Big Dave,

I tried to use this and cant seem to get it working.

Im just calling the page by typing in direct into the location bar and appending

?name=rob

to the end. I am just getting undefined for the variable myname. I have tried from a webserver and from file and neither have worked. Do i need to pass the information from a form. surely this is no different to writing it in myself?

i have seen other scripts to do this and they have been much longer than yours. This would be really handy if it were this easy!

any suggestions?

cheers

rob
 
I did something similar using a perl script instead of javascript. worked like a charm. the form passes the variable via the url from one server to the action page residing on a server that allowed cgi scripts. So maybe try using Perl instead of java? Why not just have the form page on the same server as the action page? Chandler
I ran over my dogma with karma!
 
He says right in the title &quot;no javascript&quot; DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top