Jump to content

Archived

This topic is now archived and is closed to further replies.

xtiancjs

form issues

Recommended Posts

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

Share this post


Link to post
Share on other sites
[!--quoteo(post=371836:date=May 6 2006, 12:41 PM:name=xtiancjs)--][div class=\'quotetop\']QUOTE(xtiancjs @ May 6 2006, 12:41 PM) [snapback]371836[/snapback][/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.
[code]
$vartoinsert = $dropdownvalue.$textvalue

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

$vartoinsert = $dropdownvalue . ' ' . $textvalue
[/code]

You would insert the $vartoinsert into column_a

Hope that helps.

Share this post


Link to post
Share on other sites
[!--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) [snapback]371841[/snapback][/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.
[code]
$vartoinsert = $dropdownvalue.$textvalue

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

$vartoinsert = $dropdownvalue . ' ' . $textvalue
[/code]

You would insert the $vartoinsert into column_a

Hope that helps.
[/quote]


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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.