manipulating forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • one.1more@gmail.com

    manipulating forms

    Hello,
    Consider the following form
    <form method="get" action="http://domain.com/sample.php">
    Enter first part of your email<input type="text" name="firstpart _email"
    value ="" size="20" />
    <input type="submit" value="submit" />
    </form>

    If a user inputs "joe124", what code do i add in order for the form to
    submit "joe123@user.my site.com"
    I posted this problem in alt.html, but i was told i would get a better
    off posting it in a php group.

  • seaside

    #2
    Re: manipulating forms


    one.1more@gmail .com schrieb:
    Hello,
    Consider the following form
    <form method="get" action="http://domain.com/sample.php">
    Enter first part of your email<input type="text" name="firstpart _email"
    value ="" size="20" />
    <input type="submit" value="submit" />
    </form>
    >
    If a user inputs "joe124", what code do i add in order for the form to
    submit "joe123@user.my site.com"
    Leave the form as is and do this in your PHP file:

    if ( isset( $_GET['firstpart_emai l'] )) {
    $finalAddress = $_GET['firstpart_emai l'] . '@user.mysite.c om';
    } else {
    $finalAddress = '-'; // In case no value passed
    }

    In case you'd like to do all in your form, you need a JavaScript event
    Handler.

    Comment

    • one.1more@gmail.com

      #3
      Re: manipulating forms

      thank you. It works.
      seaside wrote:
      one.1more@gmail .com schrieb:
      >
      Hello,
      Consider the following form
      <form method="get" action="http://domain.com/sample.php">
      Enter first part of your email<input type="text" name="firstpart _email"
      value ="" size="20" />
      <input type="submit" value="submit" />
      </form>

      If a user inputs "joe124", what code do i add in order for the form to
      submit "joe123@user.my site.com"
      >
      Leave the form as is and do this in your PHP file:
      >
      if ( isset( $_GET['firstpart_emai l'] )) {
      $finalAddress = $_GET['firstpart_emai l'] . '@user.mysite.c om';
      } else {
      $finalAddress = '-'; // In case no value passed
      }
      >
      In case you'd like to do all in your form, you need a JavaScript event
      Handler.

      Comment

      Working...