isvalidresponse on Surveypage doesn't work


isvalidresponse on Surveypage doesn't work

Author
Message
Konstantina
Konstantina
Distinguished Member
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)

Group: Forum Members
Posts: 18, Visits: 94
Hello,

I have two textboxes on a surveypage (among other controls like checkboxes ) and I want to check that if the first textbox is populated with a value, the second one is populated as well.
If not, the responses are not valid and the next button shouldn't take you to the next page. I tried to use the isvalid function on the Surveypage but it doesn't work.
I saw another much older post that the user was facing the same issue and it was listed as a bug. Was it resolved, should I keep trying to use the isValid on a surveypage?

If not, is it possible to set the required attribute of a textbox dynamically, according to the response of another textbox?

Thank you,
Konstantina

Dave
Dave
Supreme Being
Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)

Group: Administrators
Posts: 9.8K, Visits: 46K
What you ought to do is use the /branch attribute instead. I.e., if the 1st textbox is not empty and the 2nd is empty, run the same surveypage again:

<survey mysurvey>
/ pages = [1=pg1; 2=pg2]
/ showpagenumbers = false
/ showbackbutton = false
</survey>

<surveypage pg1>
/ caption = "Page 1"
/ questions = [1=tb1; 2=tb2]
/ branch = [if (textbox.tb1.response!="" && textbox.tb2.response=="") surveypage.pg1]
</surveypage>

<surveypage pg2>
/ caption = "Page 2"
</surveypage>

<textbox tb1>
/ required = false
</textbox>

<textbox tb2>
/ required = false
</textbox>


Konstantina
Konstantina
Distinguished Member
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)

Group: Forum Members
Posts: 18, Visits: 94
Thank you very much David!

The thing is that I am reusing the same surveypage keeping all the textboxes and checkboxes the same while I am only changing a caption.
Mystructure is more like this:

<expt spelling_test>
/ blocks = [1=spelling]
</expt>


<block spelling>
/trials = [1-2=pg1;]
</block>

<surveypage pg1>
/ caption = "Page 1"
/ questions = [1=tb1; 2=tb2]
/ branch = [if (textbox.tb1.response!="" && textbox.tb2.response=="") surveypage.pg1]
</surveypage>

<surveypage pg2>
/ caption = "Page 2"
</surveypage>

<textbox tb1>
/ required = false
</textbox>

<textbox tb2>
/ required = false
</textbox>


When I apply the code suggested the textboxes are reset after the branching.
Is there anything you can suggest in order to prevent that?

Your help is much appreciated!

Thanks,
Konstantina


Dave
Dave
Supreme Being
Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)

Group: Administrators
Posts: 9.8K, Visits: 46K
No, if you run the <surveypage>s via a <block> instead of a <survey>, there is no way to prevent them from resetting, I'm afraid.

Konstantina
Konstantina
Distinguished Member
Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)Distinguished Member (2.7K reputation)

Group: Forum Members
Posts: 18, Visits: 94
Thanks Dave! Also, just to confirm- the isvalid attribute doesn't work with surveypages. Is that correct?

Dave
Dave
Supreme Being
Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)Supreme Being (679K reputation)

Group: Administrators
Posts: 9.8K, Visits: 46K
Yes, that is correct.

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search