SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2001
    Location
    Northern Virginia
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JS varaible to Cold Fusion Variable

    here is my issue. i have a select box the user can type a value. this is done using JS.
    I now need to take that value and "convert" it over to a cold fusion variable so when the page is submitted, that variable can be used in cold fusion.
    I am not sure if this can be done or can be done easily, but converting a js variable to a cold fusion variable in something i really need.

    below is the final line of my JS which creates the js variable, and below that is the select box form that i am using.
    //what my js looks like after everything has been done
    option.text = option.text.substring(0,option.text.length)+ " added";
    var alt_string = option.text;

    //form field
    <select name="NumericAlts#loopcounter#" onChange="return beginEditing(this);">
    <option default=""></option>
    <option value="editable">Type New Alt String Here</option>
    <OPTION value=some value >some value</option>

    <input type="hidden" name="alt_string>
    i am using the input type hidden field to try to pass the js value, but it is not working.

    help!!
    dan

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Submit the form


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    Web-coding NINJA! silver trophy beetle's Avatar
    Join Date
    Jul 2002
    Location
    Dallas, TX
    Posts
    2,900
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For how long is this thread going to be sticky? sheesh....
    beetle a.k.a. Peter Bailey
    blogs: php | prophp | security | design | zen | software
    refs: dhtml | gecko | prototype | phpdocs | unicode | charsets
    tools: ide | ftp | regex | ffdev




  4. #4
    SitePoint Zealot
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    160
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <script type="text/javascript" language="JavaScript">
    var jsValue = "Hello World";
    function update(){
    document.input.changeData.value = jsValue;
    }
    </script>
    <body>

    <form name="input" action="change2.cfm" onsubmit="update()" method="post">
    <input type="hidden" name="changeData">
    <input type="submit">
    </form>

  5. #5
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by beetle
    For how long is this thread going to be sticky? sheesh....
    Don't worry, it will start getting mouldy soon and will fall back down all by itself

    To alert the staff oversights such as this, please use the report button.


Bookmarks

Posting Permissions

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