Hi, I have a form with some radio buttons that are dynamically generated. I would need to send the id attribute value as well as the value attribte value in with the GET method. I can get the value of id pretty easy (see below), but can't figure out how to inject it into the GET method when the user clicks submit.

<form name="question_form" action="recordVote.php" method="get">
    <input type="radio" name="vote" id="23" value="1" onclick="var id = this.id; alert(id)" />R-Butt 1<br />
    <input type="radio" name="vote" id="98" value="2" onclick="var id = this.id; alert(id)" />R-Butt 2<br />
    <input type="submit" value="Submit" />
</form>

Any advice?

Thanks.

Hey, I came up with this hack...

<input type="radio" name="vote" id="23" value="1" onclick="this.value = this.value+'&id='+this.id; alert(this.value)" />

Unless there is a better way to do it?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.