954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

ECHO results to textfield

Hi all, i have a DOB input that I am trying to output to a textfield called "StarSign"

The DOB works great, uploads to the database fine, What I would like to do is from the given DOB - Output the StarSign to a textfield called starsign.

i have dob_y dob_m & dob_d - On selection of the dob_d I wish the correct starsign to automatically populate.

I am working on creating the script for the starsign, but im not sure how to populate the textfield ??

Any help \ pointers on this would be great as a learning curve,

<?php 
if ($dob_m == 4 && $dob_d > 20 || $dob_m == 5 && $dob_d < 21)   strcpy(echo $ssign,"taurus");
else if (month == 5 && day > 20 || month == 6 && day < 21)    strcpy(sign,"gemini");

?>
LloydFarrell
Junior Poster
101 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

Hi all, i have a DOB input that I am trying to output to a textfield called "StarSign"

The DOB works great, uploads to the database fine, What I would like to do is from the given DOB - Output the StarSign to a textfield called starsign.

i have dob_y dob_m & dob_d - On selection of the dob_d I wish the correct starsign to automatically populate.

I am working on creating the script for the starsign, but im not sure how to populate the textfield ??

Any help \ pointers on this would be great as a learning curve,

<?php 
if ($dob_m == 4 && $dob_d > 20 || $dob_m == 5 && $dob_d < 21)   strcpy(echo $ssign,"taurus");
else if (month == 5 && day > 20 || month == 6 && day < 21)    strcpy(sign,"gemini");

?>


I am a little confused by what your saying and your code is incomplete. Can you help me understand what your doing a little better.

If you are trying to manipulate a field are you referring to the DOM or a variable?

wrivera
Junior Poster in Training
53 posts since Jan 2010
Reputation Points: 10
Solved Threads: 10
 

Hi, thanks for replying,

What im trying to do is, from the $DOB_y $DOB_m $DOB_d given by the end user, i am trying to automatically populate a textfield called "starsign"
as the user inputs thier DOB -

Once the user has entered the month and day of birth, the text field should automatically populate with the correct zodiac sign from the following code

//this is the code i am writing to check against dob_m & dob_d
if ($dob_m == 4 && $dob_d > 20 || $dob_m == 5 && $dob_d < 21)   strcpy(ssign,"taurus");
else if (month == 5 && day > 20 || month == 6 && day < 21)    strcpy(sign,"gemini");


I dont know much about php or if I should be thinking of using java script, but again, I dont really know much about Java either,

any pointers on this would be much appreciated
many thanks
Lloyd

LloydFarrell
Junior Poster
101 posts since Dec 2009
Reputation Points: 10
Solved Threads: 0
 

Hi, thanks for replying,

What im trying to do is, from the $DOB_y $DOB_m $DOB_d given by the end user, i am trying to automatically populate a textfield called "starsign" as the user inputs thier DOB -

Once the user has entered the month and day of birth, the text field should automatically populate with the correct zodiac sign from the following code

//this is the code i am writing to check against dob_m & dob_d
if ($dob_m == 4 && $dob_d > 20 || $dob_m == 5 && $dob_d < 21)   strcpy(ssign,"taurus");
else if (month == 5 && day > 20 || month == 6 && day < 21)    strcpy(sign,"gemini");

I dont know much about php or if I should be thinking of using java script, but again, I dont really know much about Java either,

any pointers on this would be much appreciated many thanks Lloyd


You need to make sure that you are actually writing one thing or another.
strcpy() is not a PHP method.
The manual is on line.

JRM
Practically a Master Poster
621 posts since Nov 2006
Reputation Points: 130
Solved Threads: 75
 

Hi, thanks for replying,

What im trying to do is, from the $DOB_y $DOB_m $DOB_d given by the end user, i am trying to automatically populate a textfield called "starsign" as the user inputs thier DOB -

Once the user has entered the month and day of birth, the text field should automatically populate with the correct zodiac sign from the following code

//this is the code i am writing to check against dob_m & dob_d
if ($dob_m == 4 && $dob_d > 20 || $dob_m == 5 && $dob_d < 21)   strcpy(ssign,"taurus");
else if (month == 5 && day > 20 || month == 6 && day < 21)    strcpy(sign,"gemini");

I dont know much about php or if I should be thinking of using java script, but again, I dont really know much about Java either,

any pointers on this would be much appreciated many thanks Lloyd


the ifs look good but you should make the statment read

if (){
$sign="Taurus";
echo $sign;
}


doing this will generate a line on an html page withe sign. You can not manipulate text fields like java or C# or as3 but you can echo or print out html tags and text. if you echo your text you will need to space or manipulate using css and html.

wrivera
Junior Poster in Training
53 posts since Jan 2010
Reputation Points: 10
Solved Threads: 10
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: