Trying to call the .click() method for a controlgroup in another method. Heres what I have so far:
$("#list").click(function() {
searchclick = true;
value = $("#listval").text().split(" - ");
window.location.href = "index.html";
item = $("#listval").attr("title");
if (item == "this") {
$("#this").click();
} else {
$("#that").click();
}
});
“#this” and “#that” are the two buttons in the control group. The control group click method is initialized like so:
$("#this, #that").click(function(){ ...code... }
Any help?
EDIT: here is what the html looks like:
<div data-role="content" class="ui-content" role="main">
<div id="item" data-role="fieldcontain">
<fieldset data-role="controlgroup" data-type="horizontal">
<legend>
</legend>
<input id="this" name="choose" value="val1" type="radio"/>
<label for="this">
val1
</label>
<input id="that" name="choose" value="val2" type="radio"/>
<label for="that">
val2
</label>
</fieldset>
</div>
...
I ended up setting the variables to Local Variables and calling them in the
index.htmlpage. Inindex.html, I used a try,catch block to check that when the page was loaded, if there are any variables in the Local Variables. Here’s my code inindex.html(after list is clicked on the other page:}catch(err){alert(err);}