48 users online (1 members and 47 guests)  


  Results 1 to 8 of 8

Related

  1. Replies: 0
  2. Labels for radio buttons inside a row    Forum: HTML Forum
    Replies: 11
  3. Replies: 1
  4. Replies: 4
  5. radio buttons    Forum: HTML Forum
    Replies: 2
  1. #1
    Necco's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2009
    Location
    Northern Indiana
    Posts
    4

    Arrow Radio Buttons Return Nothing

    Hi. First time here.. need some help, please.
    Have a form online for customer to fill in information.
    All form fields work fine, being sent to a .cfm page then the .cfm page emails me the results.
    The only thing that will not work is the radio buttons. I will C&P the code from both the .asp and the .cfm. I am hand-coding the cfm because I dont have a copy of ColdFusion. Please help if you can.
    Thanks.


    from .asp page
    <tr>
    <td colspan="2"><font face="Arial" size="2"><center>Return Shipping<img src="space.gif" width="10" height="25">

    <input type="radio" name="ship" value="yes" checked><font face="Arial" size="2">UPS Ground<img src="space.gif" width="10" height="25">

    <input type="radio" name="ship" value="yes"><font face="Arial" size="2">UPS Blue 2-Day<img src="space.gif" width="10" height="25">

    <input type="radio" name="ship" value="yes"><font face="Arial" size="2">UPS Red Next Day<img src="space.gif" width="10" height="25">

    <input type="radio" name="carrier" value="yes"><font face="Arial" size="2">Common Carrier<img src="space.gif" width="10" height="25">Other&nbsp;&nbsp;<input class="inputbox" size="15"

    Name="Other" value=""></center></td></tr>



    Relevant parts of .cfm

    <cfparam name="UPS_Ground" default="">
    <cfparam name="UPS_Blue" default="">
    <cfparam name="UPS_Red" default="">
    <cfparam name="Common_Carrier" default="">
    <cfparam name="Other" default="">

    UPS Ground=#UPS_Ground#
    UPS Blue=#UPS_Blue#
    UPS Red=#UPS_Red#
    Common Carrier=#Common_Carrier#
    Other=#Other#

    Really would appreciate someone shedding some light. I am not a coder, but was asked to do this so am just trying my best.

  2. #2
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Radio Buttons Return Nothing

    First, welcome to the wide world of coding. You will find it is one of the most frustrating and rewarding things you can do.

    I am really not familiar with Coldfusion, but I will try to help with that. I have done quite a bit of HTML, so will help with that as well.

    The two things to remember when dealing with radio buttons is that
    1. They are done in groups
    2. They are grouped according to name


    Additionally, remember that what is passed from one page to the next is not necessarily what you see on screen. When dealing with objects that are selected (lists, radio buttons, etc), what is sent is set in the value field. When dealing with objects that require keyboard interaction (text boxes, textareas, etc.), the value passed is what is entered into the field by the keyboard.

    Confused yet?

    I am not sure exactly what is wrong with the code you posted as you did not tell us either what was supposed to happen or what does happen, but I did notice some things that should change in order to make it work more efficiently.

    I will post your code first, then post my changes after that with the changes highlighted in red.

    Original:
    Code:
    <tr>
    <td colspan="2"><font face="Arial" size="2"><center>Return Shipping<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="yes" checked><font face="Arial" size="2">UPS Ground<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="yes"><font face="Arial" size="2">UPS Blue 2-Day<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="yes"><font face="Arial" size="2">UPS Red Next Day<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="carrier" value="yes"><font face="Arial" size="2">Common Carrier<img src="space.gif" width="10" height="25">Other&nbsp;&nbsp;<input class="inputbox" size="15"
    
    Name="Other" value=""></center></td></tr>
    Updated:
    Code:
    <tr>
    <td colspan="2"><font face="Arial" size="2"><center>Return Shipping<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="UPS Ground" checked><font face="Arial" size="2">UPS Ground<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="UPS Blue 2-Day"><font face="Arial" size="2">UPS Blue 2-Day<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="UPS Red Next Day"><font face="Arial" size="2">UPS Red Next Day<img src="space.gif" width="10" height="25">
    
    <input type="radio" name="ship" value="Common Carrier"><font face="Arial" size="2">Common Carrier<img src="space.gif" width="10" height="25">Other&nbsp;&nbsp;<input class="inputbox" size="15"
    
    Name="Other" value=""></center></td></tr>
    The changes I made will do a few different things. It will group all four options together. That way you can't select both "Common Carrier" and "UPS Ground". The value that is passed is now the text that appears on screen (previously, the word "yes" was passed -- there was no way of telling which option was selected).

    I will take a look at ColdFusion to see if there is anything there that needs to change. In the meantime, could you post what you mean by "not working"?

    Thanks

  3. #3
    Necco's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2009
    Location
    Northern Indiana
    Posts
    4

    Re: Radio Buttons Return Nothing

    Thanks so much for helping me.
    What should happen upon "submit" is that the choice of the radio button will be sent to me by email. Right now, all of the things returned for the radio buttons are blank in the email. There are lots of other things on the page, but they are inputboxes and they all work perfectly. They send the typed info to me in email form (as set up in the cfm page).
    I hope this is what you needed.
    Thank you for welcoming me. I felt slightly intimidated, but needed to take the plunge!

  4. #4
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Radio Buttons Return Nothing

    Have you tried making the changes I mentioned?

  5. #5
    Necco's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2009
    Location
    Northern Indiana
    Posts
    4

    Re: Radio Buttons Return Nothing

    I put in the changes you gave me but there is no change. It is not passing any selection at all.

  6. #6
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Radio Buttons Return Nothing

    The problem that I am seeing (if I am understanding what I have read about ColdFusion correctly), is that you are not looking for the right variables. The values are being passed, but you are not looking at the right variable names.

    Try adding the following line into your CF code and see what happens.
    Code:
    Shipping Method=#FORM.ship#

  7. #7
    Necco's Avatar
    New User

    Status
    Offline
    Join Date
    Jun 2009
    Location
    Northern Indiana
    Posts
    4

    Lightbulb Re: Radio Buttons Return Nothing

    YES! YES! YES!
    That did the trick!
    It is working perfectly!
    Thank you so much!

  8. #8
    jthayne's Avatar

    Status
    Offline
    Join Date
    Aug 2008
    Location
    Texas
    Posts
    508

    Re: Radio Buttons Return Nothing

    Glad I was able to help. Let us know if there is anything else we are able to do.



Tags for this Thread