Jump to content

form issues


xtiancjs

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
Link to comment
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.
Link to comment
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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.