Jump to content
Aesereht

Javascript radio input

Recommended Posts

Witam mam problem z pobraniem wartości z zaznaczonego pola typu radio

 

Kod wygląda w uproszczeniu tak:

 

<form name="calc">

...

<p><input type="radio" name="ver" value="0" id="r1" checked> Wersja 1 <input type="radio" name="ver" value="1" id="r2"> Wersja 2</p>

</form>

 

<script>

var a=evaluate(document.calc.a.value);

var b=evaluate(document.calc.b.value);

var zal;

 

if(document.class.ver.value=="0"){

zal=10

}else{

zal=12

}

function run(){

document.calc.c.value=a/b*zal;

}

</script>

 

W pogrubieniu jest fragment który sprawia problem

 

Dzięki za pomoc

Edited by Aesereht

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...