command line argument in HTML

Posted on 2012-09-15
Last Modified: 2012-09-15
how can I pass an argument to an HTML form to be used in an autoresponder webform. So where webform says:

<div class="af-textWrap"><input type="text" id="awf_field-39740557" class="text" name="custom Referred by" value=''  tabindex="502" /></div>

I want that field  to be already completed by an argument passed on the command line. Then the user can complete the other fields and submit.
Question by:kathibbetson
    LVL 49

    Expert Comment

    by:Julian Hansen
    command line.
    What do you mean by command line? How is this page being accessed?

    Are you asking how to prepopulate a field in form?

    That would entirely depend on the dev environment you are using to create the form.

    Author Comment

    yes I am asking how to prepopulate a field in form. the form would be access with
    http://www.domainname/webform-name <referrers name>

    the webform would be an html form created by an autoresponder which has for instance fields asking for name, email and referrers name. The user will enter their name and email address but I'd like the referrer field prepopulated
    LVL 49

    Accepted Solution

    You have to put code into the script creating the form to create that field. Whatever your autoresponder is will have to be coded to look for the referrer parameter (not command line - we refer to values passed through the URL as parameters) and then put that into a field in the form. In PHP this would look something like this
      if (isset($_GET['referer'])) :
    <div class="af-textWrap">
    <input type="text" id="awf_field-39740557" class="text" name="customReferredby" value='<?php echo $_GET['referer'];?>'  tabindex="502" />
    NB don't put spaces into the names of your form variables.

    Author Closing Comment

    Thnx. Yes auto responder has been setup to expect referrer field. Suspected I'd need pop but didn't know how

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 for Beginning Beginners

    Are you looking for an efficient introduction to HTML5? Have you tried other HTML5 courses and found them too complex? Do you need just the basics of HTML5 to use with Wordpress or other content management system? If you said yes to any of these questions, this course is for you.

    Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
    In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now