Javascript 在不重新加载页面的情况下更新文本字段

Javascript 在不重新加载页面的情况下更新文本字段,javascript,magento,php,Javascript,Magento,Php,我们正在使用magento多供应商网站 对于多个产品,我们在供应商帐户中显示价格、销售价格、数量等 我们为供应商提供了一个选项,通过单击一个“更新”按钮来更新单个产品的所有文本字段。工作正常,但重新加载页面后工作正常。 我想在不重新加载页面的情况下更新文本字段 为此,我们使用以下代码: Phtml <input type="hidden" name="product_mass_update[]" value="<?php echo $products->getEntityId

我们正在使用magento多供应商网站

对于多个产品,我们在供应商帐户中显示价格、销售价格、数量等

我们为供应商提供了一个选项,通过单击一个“更新”按钮来更新单个产品的所有文本字段。工作正常,但重新加载页面后工作正常。 我想在不重新加载页面的情况下更新文本字段

为此,我们使用以下代码:

Phtml

<input type="hidden" name="product_mass_update[]"  value="<?php echo $products->getEntityId(); ?>"/>
<input class="ama1" type = "text" id = "price_<?php echo $products->getId(); ?>" onkeydown="validateNumbers(event)" name= "price[]" value = "<?php echo $products->getPrice(); ?>" style = ""/>
    <input class="ama1" type = "text" id = "specialprice_<?php echo $products->getId(); ?>" onkeydown="validateNumbers(event)" name = "specialprice[]" value = "<?php echo $products->getSpecialPrice(); ?>" onblur="updateFieldSpecialPrice('<?php echo $products->getId(); ?>')" style = ""/>

我不熟悉这项技术。学习php和js。也许这会有所帮助:@Nikhil当然,我会试试……@profile-101没有人会为你做你的工作。只是一个友好的建议;在发布StackOverflow问题之前,先做一些研究和尝试。祝你好运@谢谢你,伙计,我有很多问题。有些我正在工作,有些我将在这里发布。从现在开始,我将尽可能多地尝试,然后再发布到这里。
public function massupdatesellerproAction(){
    if($this->getRequest()->isPost()){
        if(!$this->_validateFormKey()){
             $this->_redirect('marketplace/marketplaceaccount/myproductslist/');
        }
        $ids= $this->getRequest()->getParam('product_mass_update');
        $price= $this->getRequest()->getParam('price');
        $special= $this->getRequest()->getParam('specialprice');
        foreach ($ids as $key => $value) {
    $product = Mage::getModel('catalog/product')->load($value);
    $product->setPrice($price[$key]);
    $product->setSpecialPrice($special[$key]);
    $product->save();
        }
        Mage::getSingleton('core/session')->addSuccess( Mage::helper('marketplace')->__('Products has been sucessfully deleted from your account'));
        $this->_redirect('marketplace/marketplaceaccount/myproductslist/');


    }}