Loading ...
Sorry, an error occurred while loading the content.

select option value into a variable

Expand Messages
  • vijaya lakshmi
    Hi, need to take the option value of select into a php variable. Can you plz help me in doing this. ex:
    Message 1 of 3 , Sep 15, 2010
    • 0 Attachment
      Hi,
      need to take the option value of select into a php variable.

      Can you plz help me in doing this.

      ex: <select name="product">
      <option value="a">Apple</option>
      <option value="b"></option>
      </select>

      so if i select apple then another list box is to be generated.

      if i select orange a diffrent list box should be generated.

      Can you please guide me on how to go about this.

      Thanks in advance......


      --
      Thanks & Regards
      Vijayalakshmi


      [Non-text portions of this message have been removed]
    • Prashanth
      It can be easily done using Javascript than PHP. Google for such examples available freely in Javascript. -- Prashanth. +919845003672
      Message 2 of 3 , Sep 15, 2010
      • 0 Attachment
        It can be easily done using Javascript than PHP. Google for such
        examples available freely in Javascript.

        --
        Prashanth.
        +919845003672
        http://pacchiee.blogspot.com
      • janakiraman
        The following function copies the values from multi select box into another select box. Creates the option at runtime based on the value selected from the
        Message 3 of 3 , Sep 15, 2010
        • 0 Attachment
          The following function copies the values from multi select box into another select box. Creates the option at runtime based on the value selected from the multi-select box
          /**
            * Function CopyOptions()
            * @Desc Copies one option from the multi-select box
            * @Param QuestionId and Object
            * @Return null
            */
           function copyOptions(iQuestionId,sObject)
           {
            var sMultiId = 'multi_'+iQuestionId;
            var sCopyObj = document.getElementById(sMultiId);
            while(sCopyObj.options.length > 0)
            {
             sCopyObj.remove(sCopyObj.options.length - 1);
            }
            for (var iCurrent=0;iCurrent < sObject.options.length;iCurrent++)
            {
             if (sObject.options[iCurrent].selected)
                   {
                       var objOption = document.createElement("option");
                       objOption.text = sObject.options[iCurrent].text;
                       objOption.value = sObject.options[iCurrent].value;
                       var length = 0;
                          var length = sCopyObj.length;
                          sCopyObj.options[length] = objOption;
                   }
               }
           }

          --- On Wed, 15/9/10, vijaya lakshmi <vijayalakshmi6jun@...> wrote:


          From: vijaya lakshmi <vijayalakshmi6jun@...>
          Subject: [bang-phpug] select option value into a variable
          To: php-objects@yahoogroups.com, bang-phpug@yahoogroups.com
          Date: Wednesday, 15 September, 2010, 6:38 PM


           



          Hi,
          need to take the option value of select into a php variable.

          Can you plz help me in doing this.

          ex: <select name="product">
          <option value="a">Apple</option>
          <option value="b"></option>
          </select>

          so if i select apple then another list box is to be generated.

          if i select orange a diffrent list box should be generated.

          Can you please guide me on how to go about this.

          Thanks in advance......

          --
          Thanks & Regards
          Vijayalakshmi

          [Non-text portions of this message have been removed]










          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.