[Xerte] Access radio button state

rupert rupert rupert46 at gmail.com
Mon Jun 14 16:27:00 BST 2010


Thanks Julian,

Changing the condition to what you suggested means that the else statement
triggers now if the 5th radio button is selected or not, assuming I have
changed it correctly. Before it was always displaying false.

if (icon.parentNode.parentNode.childNodes[4].getValue() == false) {
  feedback.setText("false");
} else if (icon.parentNode.parentNode.childNodes[4].getValue() == true) {
  feedback.setText("true");
} else {
  feedback.setText("error");
}

Cheers
rup

On Mon, Jun 14, 2010 at 4:07 PM, Julian Tenney <
Julian.Tenney at nottingham.ac.uk> wrote:

>  Try doing getValue() == true
>
>  As sometimes the conditionals don’t work as you might expect if you leave
> out the other item:
>
>  If (true){ //you might expect this to work but it sometimes doens’t
>
>  }
>
>  If (true == true){ //do this instead
>
>  }
>
>
>
> *From:* xerte-bounces at lists.nottingham.ac.uk [mailto:
> xerte-bounces at lists.nottingham.ac.uk] *On Behalf Of *rupert rupert
> *Sent:* 14 June 2010 15:36
> *To:* xerte at lists.nottingham.ac.uk
> *Cc:* rupert46 at gmail.com
> *Subject:* [Xerte] Access radio button state
>
>
>
> Still getting to grips with the basics of Xerte I'm afraid.
>
>
> I want to access the state of the radio button group and update an array
> when the submit button is pressed. To get the states I am using something
> along these lines:
>
> if (!icon.parentNode.parentNode.childNodes[4].getValue()) {
>   feedback.setText("false");
> } else if (icon.parentNode.parentNode.childNodes[4].getValue()) {
>   feedback.setText("true");
> } else {
>   feedback.setText("error");
> }
>
> Which is not working as I expect it to, can anyone guide me towards a
> working script.
>
> Many thanks
> Rup
>
> _______________________________________________
> Xerte mailing list
> Xerte at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.nottingham.ac.uk/pipermail/xerte/attachments/20100614/63d9810b/attachment.html


More information about the Xerte mailing list