|
-
Oct 17th, 2005, 08:03 PM
#1
Thread Starter
Frenzied Member
Prefilling a TextBox?
ok i have page1 and i have another page called "index.html" in the index.html page i have a textbox called "AuthorName". how do i fill it from another page?
i tryed somthing like this but it doesn't work.
Code:
index.html?AuthorName=blahblah
Last edited by wiz126; Oct 17th, 2005 at 08:26 PM.
-
Oct 18th, 2005, 08:53 AM
#2
Member
Re: Prefilling a TextBox?
For html just set the value like the example below.
index.html?AuthorName.value="blah blah blah"
-
Oct 22nd, 2005, 12:22 PM
#3
New Member
Re: Prefilling a TextBox?
i think you are in need of some serverside lang.
PHP Code:
<?php $fillText = $_Get['AuthorName']; ?>
<html>
<head>
<title>TEST PAGE</title>
</head>
<body>
<p><input type="text" name="textbox" size="54" value="<?php echo $fillText; ?>"></p>
</body>
</html>
then try
Code:
http://yoursite.tld/path/test.html?AuthorName=blahblah
-
Oct 22nd, 2005, 01:26 PM
#4
Re: Prefilling a TextBox?
Or read the values using javascript,
PHP Code:
var qsParm = new Array();
function qs() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
}
Call qs(), then access it by using qs['authorname'];
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
|