Skip to main content
Participant
September 23, 2008
Question

Radio Buttons in HTMLHelp

  • September 23, 2008
  • 3 replies
  • 772 views
I am currently working on a project wherein I need to use radio button. However, I am experiencing a page cannot be displayed issue once I compile the project, launch the chm file, select a radio button and click on the submit button. Compiling the project on WebHelp does not give the same result. The radio button works perfectly fine. Is this a product limitation with RoboHelp for HTML? I really need to use this button. Can somebody please help me? Is there any tweak that I need to do in order to make the radio button work on a chm file? Thanks in advance.
This topic has been closed for replies.

3 replies

RoboColum_n_
Legend
September 25, 2008
Hi kirsten10.
Do you mind letting us all know the solution? It would help others in the future with a similar issue.
kirsten10Author
Participant
September 25, 2008
Here's the solution;


<title>First Topic</title>

<link rel=stylesheet href=default.css>
<script>
/**
* checkButton function
* check which button is checked inside the form
* then go to page based on the radio button's value
*
* @param null
* @return string buttonvalue
*/
function checkButton() {
// get number of radio button inside myform
var num_buttons = this.myform.radio.length;

// loop through each button
for (i = 0; i < num_buttons; i++){
// check if...ehrmm..checked
if(this.myform.radio .checked == true){
// get page
mypage = this.myform.radio
.value;
}
}
// redirect
location.href(mypage);
}
</script>
</head>
<body>
<robohelp><form name='myform'>
</robohelp>
<h1>First Topic</h1>
<p><input type=radio name=radio value='Submit_1.htm'>Button 1</p>
<p><input type=radio name=radio value='Submit_2.htm'>Button 2</p>
<p><input type=radio name=radio value='Submit_3.htm'>Button 3</p>

<p> </p>
<p><input type=button name=submit value='Click Me' onClick='javascript:checkButton()';></p>
<p> </p>
</body>
</html>
RoboColum_n_
Legend
September 24, 2008
Try looking at the link again and the location of the CHM file in relation to it. If you generate your webhelp to a different location maybe that is the issue.
Inspiring
September 24, 2008
Forms can be handled very differently on the web and in a chm file. If you want you can send me your topic and I'll have a look at it. Perhaps, I'll be able to make some recommendations. Click on my name to send email.
kirsten10Author
Participant
September 25, 2008
Have managed to solve my issue through my husband's help. LOL. Thanks a lot for the attention.
RoboColum_n_
Legend
September 23, 2008
Hi kirsten10 and welcome to the RH community.
Can you tell us what the Submit button is doing in relation to the radio button as this sounds like it is the issue. Radio buttons are not known to be an issue. It sounds like you have some sort of form containing radio buttons that users have to submit. If that is the case, check the path on the submit script.
Inspiring
September 23, 2008
Kirsten,

Colum is right in that it is your script on the submit button. It is interesting that it works when you compile to webHelp but not to a CHM. I work exclusively in CHM files, so I don't know why it might work in one and not the other. I don't use a submit button with radio buttons in chm files but I only use radio buttons for variable text within a topic.

In your true code, you should have a <INPUT TYPE=BUTTON NAME="Submit" ... ONCLICK="scriptname">
Find the 'scriptname' function in your topic and let us know what it says. Also what you'd like to have happen when the user clicks 'Submit.'

John

kirsten10Author
Participant
September 24, 2008
Thanks for the replies. What I am trying to do is if you click the "Submit" button, you will send your input to a new page. I really can't figure out where the problem lies as it works perfectly fine with WebHelp.