Jump to content

Recommended Posts

<select name="relationship" id="relationship" >
<option value="Single" name="Single"<?php echo $row['relationship'] ==Single ? "selected=\"selected\"": "" ?>> Single </option>
<option value="InaRelationship" name="InaRelationship"<?php echo $row['relationship'] ==InaRelationship ? "selected=\"selected\"": "" ?>> In a Relationship </option>
<option value="Engaged" name="Engaged"<?php echo $row['relationship'] ==Engaged ? "selected=\"selected\"": "" ?>> Engaged </option>
<option value="Married" name="Married"<?php echo $row['relationship'] ==Married ? "selected=\"selected\"": "" ?>> Married </option>
<option value="Separated" name="Separated"<?php echo $row['relationship'] ==Separated ? "selected=\"selected\"": "" ?>> Separated </option>
<option value="Divorced" name="Divorced"<?php echo $row['relationship'] ==Divorced ? "selected=\"selected\"": "" ?>> Divorced </option>
</select>

 

This drop down menu successfully sends its values to the database but it won't send "In a Relationship" (i.e. with the spaces) Above I have the code that works with no spaces between those words.....how can I put spaces between it so that when I take it out of the database it isn't all one word?

Link to comment
https://forums.phpfreaks.com/topic/123589-solved-drop-down-menu-into-database/
Share on other sites

Change

<option value="InaRelationship" name="InaRelationship"<?php echo $row['relationship'] ==InaRelationship ? "selected=\"selected\"": "" ?>> code]
to
[code]<option value="In a Relationship" name="InaRelationship"<?php echo $row['relationship'] ==InaRelationship ? "selected=\"selected\"": "" ?>> 

[/code]

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.