Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7908437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:56:11+00:00 2026-06-03T11:56:11+00:00

Is it possible to autopopulate a textbox on a page depending on a string

  • 0

Is it possible to autopopulate a textbox on a page depending on a string passed in with the URL. For example:

Say we have the following form:

<form name="form_reservation" id="form-reservation">
                    <div style="padding:10px 20px 10px 10px;">
                    <label for="reservation-id">Reservation ID</label>
                        <input name="reservation_id" id="reservation-id" class="reservationid" style="width:120px !important"/>
                        <div style="padding:5px 20px 0px 10px;" class="res_message" id="res-message">&nbsp;</div>
                        <input type="submit" class="button" value="Search Reservation" name="search_button" style="width:150px !important; margin:10px 0px 0px 5px;"/>
                        <input type="button" class="button" value="Clear" style="width:150px !important; margin:10px 0px 0px 5px;" onclick="resetForms('reservation')" />
                    </div>
                </form>

And the user received an email with a link in it: http://www.website.com/formpage.html######

Where ###### was the ID that I wanted to populate in the reservation-id field on the form. Any way to make this happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T11:56:16+00:00Added an answer on June 3, 2026 at 11:56 am

    Assuming the URL the user clicks looks like www.website.com/formpage.html?id=12345, you can spit it out into the input “value” field with GET, e.g.:

    <input value="<?php echo htmlspecialchars($_GET["id"]); ?>" name="reservation_id" id="reservation-id" class="reservationid" style="width:120px !important" />
    

    This is the way to do it with php.

    EDIT:

    Per @Esailija’s comment, I wrapped it in the htmlspecialchars function, which as far as I understand will help safeguard against XSS attacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: Finding the Variable Name passed to a Function in C# In C#,
Possible Duplicate: Opening url in new tab while i am doing window.open(), my page
Possible Duplicate: Split A4 PDF page into two A5 and back again I have
Possible Duplicate: When do you use the “this” keyword? If I have the following
Possible Duplicate: Concatenate many rows into a single text string? I have a query
Is it possible to have VIM auto populate a file based on the extension?
Find the field names of inputtable form fields in a PDF document? I have
Possible Duplicate: How to call a JavaScript function from PHP? I have a php
I have three form inputs for people to input certain tax rates(tax_one, tax_two, sales_tax)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.