javascript - Redirecting customers based on the product they select -


I have a shopping cart and based on product.id , I need to send one A potential customer for the relevant URL (Farm Action URL)

Here's my HTML:

    

Can I read the value field in some way with javascript or without some jQuery code (which I will include in the header section ) And then, within the code, something defined as the result:

  if id = "00001" form action = "http://domain.com/page1.php" if id = " 00002 "form action =" addomain.com/page2.php "if id =" 00003 "form action =" http://domain.com/page3.php "if id =" 00004 "form action =" http: / / Domain.com/page4.php "If ID =" 00005 "form action So, if the user clicks on the order ID = "00002" and "Add to cart" button, he / she will not < Code> http://domain.com/page2.php . Or, if a user chooses the product ID "00004" and clicks the "Add to Cart" button, then they will go straight to  http://domain.com/page4.php .   

In short, I need to redirect the prospective customer to a different page, depending on the order of their product. How can I do this?

You can do this:

  & lt; Script & gt; Var yourid = $ ("input [name = 'id']") Val (); If (yourid = "someid") $ ("form [name = 'product_form']"). Attr ("action", "your_link"); & Lt; / Script & gt;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -