473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Ajax windows not show up on onclick="submit

Hi,

I am trying to figiure out why Ajax pop-up window not works with radio button (<input type="radio" onclick="submit()" >). But it works with input type=submit value=value="<?php echo $VM_LANG->_('PHPSHOP_CART_ADD_TO') ?> ).

If There is button when user click on it the pop-up messege will come up and user stays at the same webpage. ut with radio button ofter Click user is redirected to the Virtuemart shopping cart but I wish that Ajax pop-up windows will comeup. I posted few topics on Virtuemart forum about it but no advices in there.
The code is:

Expand|Select|Wrap|Line Numbers
  1. <form action="<?php echo $mm_action_url ?>index.php" method="post" 
  2. name="addtocart" id="<?php echo uniqid('addtocart_') ?>" class="addtocart_form" 
  3. <?php if( $this->get_cfg( 'useAjaxCartActions', 1 ) && !$notify ) { 
  4. echo 'onsubmit="handleAddToCart( this.id );return false;"'; } ?>>
  5. <?php}echo $html;if (USE_AS_CATALOGUE != '1' && $product_price != "" && !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )) {
  6.     ?>
  7.         <?php if ($children != "multi") { ?>
  8.      <div style="float: right;vertical-align: middle;"> 
  9. <?php
  10.      if ($children == "drop") {
  11.          echo $ps_product_attribute->show_quantity_box($product_id,$product_id);
  12.     }
  13.      if ($children == "radio") {
  14.         echo $ps_product_attribute->show_radio_quantity_box();
  15.     }
  16.     $button_lbl = $VM_LANG->_('PHPSHOP_CART_ADD_TO');
  17.     $button_cls = 'addtocart_button';
  18.     if( CHECK_STOCK == '1' && !$product_in_stock ) {
  19.          $button_lbl = $VM_LANG->_('VM_CART_NOTIFY');
  20.          $button_cls = 'notify_button';
  21.     }
  22.     ?>
  23.         <input type="radio"   onclick="submit()"    value="<?php echo $VM_LANG->_('PHPSHOP_CART_ADD_TO') ?> />
  24.     </div>
  25.     <?php  } ?>
  26.         <input type="hidden" name="flypage" value="shop.<?php echo $flypage ?>" />
  27.     <input type="hidden" name="page" value="shop.cart" />
  28.     <input type="hidden" name="manufacturer_id" value="<?php echo $manufacturer_id ?>" />
  29.     <input type="hidden" name="category_id" value="<?php echo $category_id ?>" />
  30.     <input type="hidden" name="func" value="cartAdd" />
  31.     <input type="hidden" name="option" value="<?php echo $option ?>" />    
  32. <input type="hidden" name="Itemid" value="<?php echo $Itemid ?>" />
  33.     <input type="hidden" name="set_price[]" value="" />
  34.     <input type="hidden" name="adjust_price[]" value="" />
  35.     <input type="hidden" name="master_product[]" value="" />
  36.  
Maybe somebody has a suggestion why Ajax not works with radio button, I understand that there is something related to onclick="submit()" .

Thanks andd regards
May 4 '11 #1
1 2250
acoder
16,027 Expert Mod 8TB
With the submit button, it's calling the handleAddToCart function called in the onsubmit handler. Perhaps that what you need to call for the radio button.

What is the submit() function anyway?
May 10 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: NotGiven | last post by:
I changed my POST to GET and find appended to the url, the above string. Why and what can I do to NOT have them appended? Thanks.
3
by: news | last post by:
I'm working with a CGI program that was using several standard buttons for input using <input type="submit" name="abuttonName" ... Now, I'm trying to replace the standard buttons with images...
3
by: Pete Wilson | last post by:
How can I highlight the <input type="submit"> object that I want to highlight? 1. In my form, the user enters his ID. He sees two submit "buttons," left labeled Cancel, the right labeled Signup....
6
by: Bart van Deenen | last post by:
Hi All I'm happily creating an Ajaxified web-app. I use Prototype for encapsulating xml http requests, with method "post". On the backend, I use PHP, and the replies are eval'd by Javascript. I...
6
by: GD | last post by:
Hi, I wonder how to disable the "submit" behavior of a button. What I want is to assign values to dynamically added user controls without page postback. Problem: dynamically created control can...
4
by: Martin | last post by:
I have a form with two submit buttons: <Save> and <Cancel>. When the user clicks on <Save>, I want to execute a validate function. When he clicks on <Cancel>, I want the form to submit without...
2
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the...
1
by: grantmx | last post by:
Hey guys - We am having problems with the following code in our form: <tr><td></td><td align=right><input type="image" name="_ctl25:btnSaveLarge" onclick="if (typeof(Page_ClientValidate) ==...
2
by: ChrisLA | last post by:
Hi; I've seen lots of discussion & disagreement on this issue, so any good explanation would be appreciated. Some people seem to think that "document.GetElementByID("MyName").submit(); should...
1
by: burtonfigg | last post by:
I have an ecard site. Part of that site allows users to enter their own message which then appears within a flash SWF file. This is an example page: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.