www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to change hidden field with onclick?

  1. #1
    Join Date
    Jul 2005
    Posts
    1

    How to change hidden field with onclick?

    I know this should be simple, but I can't quite get the right syntax to change the value of a hidden field by selecting one of two radio buttons. Here's what I'm looking to do in pseudo code:
    Code:
    <input type="radio" name="public" value="1" onclick="change hidden field wishopt to value of 1">
    
    <input type="radio" name="public" value="" onclick="change hidden field wishopt to value of 0">
    
    <input type="hidden" name="wishopt" value="whatever the radio buttons say">
    This make sense? If anyone can point me in the right direction I'd really appreciate it.

    Thanks,

    Marv

  2. #2
    Join Date
    Jun 2004
    Location
    Portsmouth UK
    Posts
    2,689
    same way as input type text

    document.myform.myhiddeninput.value='whatever';
    Vic

    God loves you and will never love you less.

    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles