Web Analytics Made Easy -
StatCounter Send a variable to a hidden input's value - CodingForum

Announcement

Collapse
No announcement yet.

Send a variable to a hidden input's value

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Send a variable to a hidden input's value

    As described in the title, I want to send a variable to a hidden input's value...
    Which means that the input's value (value="value") will have the variables value...
    I got this code for example:
    Code:
    var arrow = "";
    function addBG(name){
    	if (arrow == ""){
    		document.getElementById("addBG"+name).style.borderWidth = "2px";
    		document.getElementById("addBG"+name).style.borderColor = "black";
    	}
    	else{
    		document.getElementById("addBG"+arrow).style.borderWidth = "0px";
    		document.getElementById("addBG"+name).style.borderWidth = "2px";
    		document.getElementById("addBG"+name).style.borderColor = "black";
    	}
    	arrow = name;
    	document.getElementById("remove").innerHTML = "<a href=javascript:document.remove.submit()>Remove Selected Image</a>";
    }
    Here I submit this form:

    Code:
    <form name="remove" method="post">
    <input type="hidden" name="Delete" value="??">
    </form>
    But I want the value of the hidden input to be the arrow variable...
    How can I do this?


    Thanks for the helpers.

  • #2
    function addBG(name){
    if (arrow == ""){
    document.getElementById("addBG"+name).style.borderWidth = "2px";
    document.getElementById("addBG"+name).style.borderColor = "black";
    }
    else{
    document.getElementById("addBG"+arrow).style.borderWidth = "0px";
    document.getElementById("addBG"+name).style.borderWidth = "2px";
    document.getElementById("addBG"+name).style.borderColor = "black";
    }
    arrow = name;
    document.getElementById("remove").innerHTML = "<a href=javascript:document.remove.submit()>Remove Selected Image</a>";
    document.remove.Delete.value = arrow;
    }
    public string ConjunctionJunction(string words, string phrases, string clauses)
    {
    return (String)(words + phrases + clauses);
    }
    <--- Was I Helpfull? Let me know ---<

    Comment


    • #3
      however i must first ask why you are doing this all in js?

      why not just create a checklist and submit that?
      public string ConjunctionJunction(string words, string phrases, string clauses)
      {
      return (String)(words + phrases + clauses);
      }
      <--- Was I Helpfull? Let me know ---<

      Comment


      • #4
        Hey, That doesn't work... I've tried using document.Remove.Delete.value but it didn't work...
        Any other suggestions?

        Edit: Oh, Sorry, That works! Thanks alot!
        Last edited by BarrMan; Sep 30, 2006, 02:18 PM. Reason: My bad...

        Comment

        Working...
        X