command line argument in HTML

Posted on 2012-09-15
Medium Priority
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
  • 2
  • 2
LVL 60

Expert Comment

by:Julian Hansen
ID: 38401923
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

ID: 38401944
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 60

Accepted Solution

Julian Hansen earned 2000 total points
ID: 38401963
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

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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
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…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Suggested Courses

839 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