Results 1 to 4 of 4

Thread: Prefilling a TextBox?

  1. #1

    Thread Starter
    Frenzied Member wiz126's Avatar
    Join Date
    Jul 2005
    Location
    Mars,Milky Way... Chit Chat Posts: 5,733
    Posts
    1,080

    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.
    1) If your post has been adequately answered please click in your post on "Mark Thread Resolved".
    2) If someone has been useful to you please show your respect by rating their posts.
    3) Please use [highlight="VB"] 'your code goes in here [/highlight] tags when posting code.
    4) Before posting your question, make sure you checked this links:
    MICROSOFT MSDN -- VB FORUMS SEARCH

    5)Support Classic VB - A PETITION TO MICROSOFT

    ___________________________________________________________________________________
    THINGS TO KNOW ABOUT VB: || VB Examples/Demos
    What are Classes?
    || -
    Where to place a sub/function?(global) || Webbrowser control

  2. #2
    Member
    Join Date
    Oct 2005
    Posts
    35

    Re: Prefilling a TextBox?

    For html just set the value like the example below.

    index.html?AuthorName.value="blah blah blah"

  3. #3
    New Member
    Join Date
    Oct 2005
    Posts
    4

    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

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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=0i<parms.lengthi++) {
       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
  •  



Click Here to Expand Forum to Full Width