close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Repeat selection determined by radio input selection

Thread began 11/28/2022 5:41 am by s.joiner74419001 | Last modified 11/29/2022 9:14 am by Ray Borduin | 66 views | 5 replies |

s.joiner74419001

Repeat selection determined by radio input selection

I have a multi-step form which runs across 5 pages. Page 4 has a radio input field with 6 options which are simply numbers 1-6. what ever number is selected, i would like it to determine the amount of repeats the repeat selection on the next page ( page 5 ). I will then want to use a multiple insert behaviour on the repeat selection.

I’ve tried this so far:

I applied a form data binding to use the radio input value on page 4 as the dynamic value in the repeat selection on page 5 as follows:

<?php
$wa_repeatfor = ".((isset($_POST["specify"]))?$_POST["specify"]:"") ."; // Repeat Selection 1
$wa_repeatcount = 0;
while ($wa_repeatfor) {
$wa_repeatfor--;
$wa_repeatcount++;
?>

this causes a 500 error to the page.

Any idea what I’m doing wrong here.

I’ve attached the two pages..

Thanks in advance

Attached Files
application-form-dir-a.php
application-form-dir-b.php
Sign in to reply to this post

Ray BorduinWebAssist

I'd need FTP access and a url with steps to reproduce the issue in order to debug this one.

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

OK thanks Ray see PM

Sign in to reply to this post

Ray BorduinWebAssist

Try:

$wa_repeatfor = ((isset($_POST["specify"]))?intval($_POST["specify"]):0); // Repeat Selection 1

Sign in to reply to this post
Did this help? Tips are appreciated...

s.joiner74419001

Hi Ray,

Thanks for this, your code update works great now.

There is another issue I have now which is with the jQuery validate plugin I’m using with the forms.

It’s basically an error placement issue with the radio input field.

Before I used the repeat selection with this I used the code below to display the errors in the correct elements below the form group

if ( element.attr( "name" ) === "title_1" ) {
error.appendTo( "#title-error" );
}
else if ( element.attr( "name" ) === "title_2" ) {
error.appendTo( "#title2-error" );
}
else if ( element.attr( "name" ) === "title_3" ) {
error.appendTo( "#title3-error" );
}
else if ( element.attr( "name" ) === "title_4" ) {
error.appendTo( "#title4-error" );
}
else if ( element.attr( "name" ) === "title_5” ) {
error.appendTo( "#title5-error" );
}
else if ( element.attr( "name" ) === "title_6” ) {
error.appendTo( "#title6-error" );
}
else {
error.insertAfter( element );
}

Here’s the html sample of form group 1

<div class="form-group">
….radio inputs here
<div id="title-error"></div>
</div>

So this displayed the error message nicely below each form group. ( see screenshot_a )

The reason for this is if I just let the plugin handle the error placement it gets put inside the first radio button div ( see screenshot_b )

So because the repeat selection doesn’t dynamically create the numbers for the error message element, I’m stuck with the screenshot_b.

I would also like to have each section title dynamically created too..

i.e Director 1 … Director 2 … Director 3 etc.

i'm aware this is a javascript / jquery issue.

Is this something you could help with in a support ticket?

Many thanks

Steve

Sign in to reply to this post

Ray BorduinWebAssist

Yes. I can help with that in a support ticket. Just give me a call and we can set up a time.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...