1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Id and radiobuttons?

Discussion in 'PHP' started by Coderunner, May 17, 2006.

  1. #1
    Hello guys!

    I wonder if you can help me out a bit here?
    I have a "blackout" and dont know how to proceed with radiobuttons and id..

    So what i want is that if you have sevral radiobuttons with text boxes behind
    it with text (or without text) i can simply select one radiobutton linked to the
    data in the textboxes and change the text behind the buttom. I hope you get
    what i want here :p

    Here's the code:

    While ($row = mysql_fetch_array($result,MYSQL_ASSOC))
    {
    echo "<INPUT type=\"radio\" name=\"isradio\" value=\"".$id."\">";

    foreach($row as $value)
    {



    echo $value."&nbsp;";

    }
    echo "<br>";
    }
    echo "<INPUT type=\"radio\" name=\"isradio\" value=\"".$id."\">";
    echo "<form name=\"random\" method=\"POST\" action=\"".$PHP_SELF."\">";

    echo "<input type=\"text\" name=\"namn\" size=\"12\" maxlenght=\"11\">"; // ex. name

    echo "<input type=\"text\" name=\"byear\" size=\"5\" maxlenght=\"4\">"; //Year of birth or what ever..

    echo "<input type=\"submit\" value=\"Send\">"; //send data buttom

    echo "</form>";

    mysql_close($link);




    I dont ask for a complete code :p (but im thankful if i get) just some guidelines!

    Thx in advance!
     
    Coderunner, May 17, 2006 IP
  2. MarkB

    MarkB Peon

    Messages:
    33
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you mean you will have descriptive text (say a paragraph) for each radio button, and that text is only shown if its partnered radio button is selected?
     
    MarkB, May 17, 2006 IP
  3. Coderunner

    Coderunner Guest

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    No. When i insert data in the text fields and then press the "send" buttom
    i get a new row and that shall is the displayed in the browser.
    So all text that has been writen and sent to the database in this program
    shall be shown. The thing that i want is to be abel to change the text in one
    of the existing rows by using radio buttoms, so lets say:

    i have 6 rows of diffrent text fields displayed over and below
    (like this: o=radiobuttom

    o [text field 1] [text field 2] (1)
    o [text field 1] [text field 2] (2)
    o [text field 1] [text field 2] (3)
    o [text field 1] [text field 2] (4)
    o [text field 1] [text field 2] (5)
    o [text field 1] [text field 2] (6)

    )

    So it will look something like this in the browser

    Now if i want to change the text in row 4 i simply select the radiobutton and
    put in new text then press the "send" buttom and then a refresh of the
    browser is done and i have changed the text in row 4

    so it would look like this:

    (like this: o=radiobuttom

    o [text field 1] [text field 2] (1)
    o [text field 1] [text field 2] (2)
    o [text field 1] [text field 2] (3)
    o [new text here] [and here] (4)
    o [text field 1] [text field 2] (5)
    o [text field 1] [text field 2] (6)

    )

    Maybe i should have done this example in the first post :p

    Anyway i hope you get it now!
    Thx for the reply!
     
    Coderunner, May 17, 2006 IP