Jump to content


Photo

form issues


  • Please log in to reply
2 replies to this topic

#1 xtiancjs

xtiancjs
  • Members
  • PipPipPip
  • Advanced Member
  • 47 posts

Posted 06 May 2006 - 04:41 PM

Hi, just wondering if it is possible to insert into the same db field from 2 different text input areas in the same form?
I have a a drop down menu which inserts the info into column_a on the db , on the same form I have a text field that I want to also insert the info into column_a,


Xtian

#2 freakus_maximus

freakus_maximus
  • Members
  • PipPipPip
  • Advanced Member
  • 177 posts

Posted 06 May 2006 - 05:27 PM

[!--quoteo(post=371836:date=May 6 2006, 12:41 PM:name=xtiancjs)--][div class=\'quotetop\']QUOTE(xtiancjs @ May 6 2006, 12:41 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Hi, just wondering if it is possible to insert into the same db field from 2 different text input areas in the same form?
I have a a drop down menu which inserts the info into column_a on the db , on the same form I have a text field that I want to also insert the info into column_a,
Xtian
[/quote]


What you want is possible, sure, but not via 2 inserts. You would end up overwriting what you had with the 2 insert.

You should just put both values into 1 variable and submit that variable to be inserted.

So, on the php page that process your insert, after you get the variables from your form.
$vartoinsert = $dropdownvalue.$textvalue

//or if you want a space in between the two do this 

$vartoinsert = $dropdownvalue . ' ' . $textvalue

You would insert the $vartoinsert into column_a

Hope that helps.

#3 xtiancjs

xtiancjs
  • Members
  • PipPipPip
  • Advanced Member
  • 47 posts

Posted 06 May 2006 - 05:41 PM

[!--quoteo(post=371841:date=May 6 2006, 01:27 PM:name=freakus_maximus)--][div class=\'quotetop\']QUOTE(freakus_maximus @ May 6 2006, 01:27 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
What you want is possible, sure, but not via 2 inserts. You would end up overwriting what you had with the 2 insert.

You should just put both values into 1 variable and submit that variable to be inserted.

So, on the php page that process your insert, after you get the variables from your form.
$vartoinsert = $dropdownvalue.$textvalue

//or if you want a space in between the two do this 

$vartoinsert = $dropdownvalue . ' ' . $textvalue

You would insert the $vartoinsert into column_a

Hope that helps.
[/quote]


Freakus, thanks for the reply, will give it a shot
xtian




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users