• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 434
  • Last Modified:

command line argument in HTML

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.
0
kathibbetson
Asked:
kathibbetson
  • 2
  • 2
1 Solution
 
Julian HansenCommented:
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.
0
 
kathibbetsonAuthor Commented:
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
0
 
Julian HansenCommented:
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
<?php
  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" />
</div>
<?php
endif;
?>
NB don't put spaces into the names of your form variables.
0
 
kathibbetsonAuthor Commented:
Thnx. Yes auto responder has been setup to expect referrer field. Suspected I'd need pop but didn't know how
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now