Send Dynamic form Values to PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #16
    Hi I have to Open this thread again.
    see here in my dynamic form again i have to put a <textarea> to pass the Inquiries to database.Along with a Hidden value field(ID).
    The ID will always send to php page since it is hidden and always there is value.
    But if user doesn't type a Value to textarea(S) array of comma will pass.
    I need find out a way to give a default value to text area if user does not type a Value.
    Again I need to update the MySQL table with new Inquiries values. Thats why i am getting this ID to the hidden fields.

    [PHP]
    /*This is in side while loop and will repeat*/
    echo '<input type="hidden" name="frm_id[]" value="'.$id.'"/>
    <textarea name="frm_inq[]" cols="65" rows="3" ></textarea>';
    [/PHP]

    [PHP]<?php
    $inq = $_REQUEST['frm_inq'];
    $ids = $_REQUEST['frm_id'];

    $list_of_ids = implode(",", $ids);
    $list_of_inq = implode(",", $inq);

    echo $list_of_ids;
    echo '<BR>';
    echo $list_of_inq;
    // I need to Update mySQL table Here For Now I'll will Print it
    ?>[/PHP]

    How to update mytable from these values
    sample Output

    Code:
    1001,1002
    I need to pass this is for 1001 Record ,this is for 1002
    Any Idea About this?

    Comment

    • gauravgmbhr
      New Member
      • Feb 2007
      • 107

      #17
      Originally posted by ajaxrand
      Hi I have to Open this thread again.
      see here in my dynamic form again i have to put a <textarea> to pass the Inquiries to database.Along with a Hidden value field(ID).
      The ID will always send to php page since it is hidden and always there is value.
      But if user doesn't type a Value to textarea(S) array of comma will pass.
      I need find out a way to give a default value to text area if user does not type a Value.
      Again I need to update the MySQL table with new Inquiries values. Thats why i am getting this ID to the hidden fields.

      [PHP]
      /*This is in side while loop and will repeat*/
      echo '<input type="hidden" name="frm_id[]" value="'.$id.'"/>
      <textarea name="frm_inq[]" cols="65" rows="3" ></textarea>';
      [/PHP]

      [PHP]<?php
      $inq = $_REQUEST['frm_inq'];
      $ids = $_REQUEST['frm_id'];

      $list_of_ids = implode(",", $ids);
      $list_of_inq = implode(",", $inq);

      echo $list_of_ids;
      echo '<BR>';
      echo $list_of_inq;
      // I need to Update mySQL table Here For Now I'll will Print it
      ?>[/PHP]

      How to update mytable from these values
      sample Output

      Code:
      1001,1002
      I need to pass this is for 1001 Record ,this is for 1002
      Any Idea About this?

      its simple


      use
      value attribute in text area like

      Code:
      <textarea name="something" [B]value="default text"[/B]>

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #18
        Originally posted by gauravgmbhr
        its simple


        use
        value attribute in text area like

        Code:
        <textarea name="something" [B]value="default text"[/B]>
        I think <textarea> is not using this value attribute like other HTML form elements.
        Please refer to this http://www.thescripts.com/forum/thread602808.html .
        [HTML]<textarea>PHP will get Contents from Here</textarea>[/HTML]

        I think for the PHP side i have to do some thing for this.
        How ever after getting that Values how to pass this to MySQL.
        Because its a Gettng as two arrays.

        Comment

        • gauravgmbhr
          New Member
          • Feb 2007
          • 107

          #19
          WELL RIGHT
          THE VALUE ATTRIBUTE IS APPLICABLE IN <input type="text">
          NOT IN TEXT AREA

          Comment

          Working...