javascript - Access and Display post values on a html page using JQuery -


After trying to show the cells in a table table after I have posted by another form, For this, my code is below. Here I am trying to add the value of the selection box in the unbound_AdultVal hidden field using JQuery.

  & lt; Form enctype = "multipart / form-data" method = "post" action = "summary html" name = "form" & gt; & Lt; Input id = "unbound_CurrentStepID" type = "hidden" value = "step_Two" name = "unbound_CurrentStepID" & gt; & Lt; Input id = "unbound_at ult vall" type = "hidden" value = "" name = "unbound_addle val" & gt; Age 10+: & lt; Select ID = "UnboundTicket" name = "unbound quantity" & gt; & Lt; Option selected = "selected" value = "0" & ​​gt; 0 & lt; / Options & gt; & Lt; Option value = "1" & gt; 1 & lt; / Options & gt; & Lt; Option value = "2" & gt; 2 & lt; / Options & gt; & Lt; Option value = "3" & gt; 3 & lt; / Options & gt; & Lt; Option value = "4" & gt; 4 & lt; / Options & gt; & Lt; Option value = "5" & gt; 5 & ​​lt; / Options & gt; & Lt; Option value = "6" & gt; 6 & lt; / Options & gt; & Lt; Option value = "7" & gt; 7 & lt; / Options & gt; & Lt; Option value = "8" & gt; 8 & lt; / Options & gt; & Lt; Option value = "9" & gt; 9 & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = "submit" value = "continue" name = "submit" & gt; & Lt; / Form & gt; & Lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {var numDAdult = $ ("# unbound_Ticket"). Val (); $ ("# unbound_Ticket") .changes (function () {numDAdult = $ ("# unbound_Ticket") Val (); $ ('Input [name = Unbound_AdultVal]'). Val (numDAdult);});}); & Lt; / Script & gt;   

Below is a summary code where I want to display the hidden field value

  & lt; Form enctype = "multipart / form-data" method = "post" action = "summary.html" name = "form" & gt; & Lt; Input id = "unbound_CurrentStepID" type = "hidden" value = "Form_Three" name = "unbound_ currentStepID" & gt; & Lt; Width of the table = "800" border = "1" align = "center" cellpadding = "5" cellspacing = "0" & ​​gt; & Lt; TR & gt; & Lt; TD width = "381" & gt; & Lt; Strong & gt; Quantity & lt; / Strong> & Lt; / Td> & Lt; Td width = "242" & gt; & Lt; Strong & gt; Ticket price & lt; / Strong> & Lt; / Td> & Lt; Td width = "139" & gt; & Lt; Strong & gt; Total value & lt; / Strong> & Lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt; Span id = "postAdultvalue" & gt; & Lt; / Span & gt; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td colspan = "3" align = "right" & gt; & Lt; Strong & gt; Due to the current amount: $ 0 & lt; / Strong> & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt;   

  & lt; Script type = "text / javascript" & gt; $ (Document) .ready (function () {$ ("# postAdultvalue"). Text ($ ("# unbound_AdultVal"). Val ());}); & Lt; / Script & gt;   

I have a hard time displaying the price posted in the table while using JQuery as I am very new, please forgive my ignorance.

  & lt; Input id = "Unbound_AdultVal" type = "hidden" ** value = "" ** name = "unbound_adultval" & gt;   

The value is set to POST variable (eg, PHP: $ _POST ["name"], Cold Fusion: #form.name #).

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -