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");

?>

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?

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

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.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.