close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

How to create compare products?

Thread began 2/26/2016 5:25 am by Kumel | Last modified 2/26/2016 12:38 pm by Ray Borduin | 809 views | 4 replies |

Kumel

How to create compare products?

After creating all dataassist pages, i got a page where there are all products displayed. I would want user to click compare checkbox of each products (whichever he want to compare) & then click submit & then display those products selected in next page.

How do we do this?

Sign in to reply to this post

Ray BorduinWebAssist

You add a checkbox with the ID for the record set as the value into your repeated region. Make sure the name ends with [] (that tells php that it can have more than one value). Then use DataAssist search on the compare results page with a type list comparison passing the field name (without the brackets) and that should do it.

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

Kumel

Currently on page: compare.php
List of users are displayed with company names.
there like 20 users.

Currently this is how it looks like:


<table border="0" cellpadding="5" cellspacing="5">
<tr>
<td>Choose</td>

<td>ID</td>
<td>EmpID</td>
<td>Image</td>
<td>FirstName</td>
<td>LastName</td>
<td>CompanyID</td>
</tr>
<form action="compare-results.php" method="get" name="compare">

<?php do { ?>
<tr>

<td><input name="id[]" type="checkbox" value="<?php echo $row_Users['ID']; ?>" /></td>
<td><?php echo $row_Users['ID']; ?></td>
<td><?php echo $row_Users['EmpID']; ?></td>
<td><?php echo $row_Users['Image']; ?></td>
<td><?php echo $row_Users['FirstName']; ?></td>
<td><?php echo $row_Users['LastName']; ?></td>
<td><?php echo $row_Users['CompanyID']; ?></td>



</tr>
<?php } while ($row_Users = mysql_fetch_assoc($Users)); ?>
<tr>
<td>
<input name="Submit" type="submit" />
</td>
</tr>
</form>

</table>



  "Make sure the name ends with [] (that tells php that it can have more than one value)"  

- So thats refers to checkbox name right?

What about form method its going to be GET or POST?

  "Then use DataAssist search on the compare results page with a type list comparison passing the field name (without the brackets) and that should do it. -  

- I want results to be shown on compare-results.php
So i need to go to compare-results.php and use dataassist as said? So then what does "passing the field name (without the brackets)" there is a field named "id[]" which is with brackets.

Now i am at Multiple Search Results tab under Data Assist search wizard. then here i choose Column as ID, Column Type as Number/Boolean,

Then there is "Exact match form field " options are: New form field, id[] , Submit.

So what needs to be choosen.

Confused here.

I choosed it has id[]


Pages attached..

No results just entire list is appearing.

Sign in to reply to this post

Ray BorduinWebAssist

Change line 16 to:
$WADbSearch1->addComparisonFromList("ID","id","AND","=",0);

Since there are multiple values you have to use a type"List" and not type "Edit" search. On this page you don't use the brackets when referring to the list name.

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

Kumel

Seems perfect. Thanks.

Sign in to reply to this post

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...