|
-
Jun 9th, 2004, 12:58 PM
#1
Thread Starter
Frenzied Member
Fill HTML input box?
Is there a way you can tell an HTML code (from the URL) to fill a input box with a value?
Something like
index.htm?txt1=name
-
Jun 10th, 2004, 06:32 AM
#2
Frenzied Member
No, but you can do it with JavaScript, using the window.location variable I think, and then parse it out...
I can make an example if you want
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Jun 10th, 2004, 06:33 AM
#3
Frenzied Member
My bad, It's location.href
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Jun 10th, 2004, 06:45 AM
#4
Frenzied Member
Here's a rather undymanic example, but it should do about what you say, just pass txt1=yourtext, and and it should parse it ok =).
Code:
<html>
<body>
<form name=myform>
<input type=text name=txt1>
</form>
<script>
var loc=location.href;
if (loc.indexOf("txt1=") > -1) {
document.myform.txt1.value = loc.substr(loc.indexOf("txt1=")+5,loc.length);
}
</script>
</body>
</html>
Hope it helped
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|