two values for one name in input

前端 未结 5 2178
天涯浪人
天涯浪人 2021-01-05 05:39

I have one input (type radio) that I want to insert it 2 values, something like that:



        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-05 06:30

    Well, not the way I would do it, but you could use a delimiter for your value(s)

    
    

    Then, in PHP, just list($value1,$value2) = explode('|', $_POST['two_values']);

    EDIT
    As @user387302 said, you would obviously be limited to not having any values containing your delimiter, for example value="One|PipedVariable|andAnother" would not work to extract two values of "One|PipedValue" and "andAnother"

提交回复
热议问题