Python Forum
phython language java integration
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
phython language java integration
I am attempting to submit a HTML form that has some values created via javascript. However, when I submit the form those input fields lose their values in favor of empty strings. What can I do to prevent the fields from dropping their new values upon hitting the submit button?

Form Code:

<form id="post-form" class="save-form" method="POST" action="/posts" style="display: none"> <input placeholder="Title" name="title" /><br> <input placeholder="Location" name="location" /></br> <input placeholder="Content" name="content" /><br> <input id="formlat" name="latitude" type="hidden" /> <input id="formlng" name="longitude" type="hidden" /> <input name="user_id" type="hidden" value="<%= %>" /> <input type="submit" value="Submit"/> </form>
Relevant Javascript Code:

var newlat = newmarker.getPosition().lat(); var newlng = newmarker.getPosition().lng(); document.getElementById("formlat").value = newlat; document.getElementById("formlng").value = newlng;
Setting default values, or not setting them, always produces the same result: the form submits with "" for those fields (or whatever was inside value=""). However, the console shows that those fields are correctly being filled with their lat/long up until I hit the submit button, where they revert to their default values (in this case ""). It is only in rails' logs that I can see the fields are blank in the actual POST.

User has been warned for this post. Reason: No BBcode, Multiple threads
if you set a default value, and it submits "" instead, then clearly it is not using that default value. have you followed the value through the code? what python code is involved with this?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Integration Pandas excel - Python Gegemendes 5 395 Jun-05-2022, 09:46 PM
Last Post: Gegemendes
Photo Integration of apache spark and Kafka on eclipse pyspark aupres 1 2,268 Feb-27-2021, 08:38 AM
Last Post: Serafim
  issue with Tabula-py, pyinstaller and java maurom82 2 1,872 Feb-19-2021, 04:32 PM
Last Post: buran
  Tableau Time Series Prediction using Python Integration tobimarsh43 0 1,153 Jul-24-2020, 10:38 AM
Last Post: tobimarsh43
  R-PYTHON INTEGRATION RELATED PROBLEM arnab93 0 988 Jun-05-2020, 02:07 PM
Last Post: arnab93
  STATA/Python Integration jprender 0 1,168 May-03-2020, 09:38 PM
Last Post: jprender
  Can't install Phython Ricardo14 1 1,140 Jan-31-2020, 12:04 PM
Last Post: metulburr
  How to insert record into MySQL using Phython abhay_kala 1 1,381 Dec-06-2019, 04:34 PM
Last Post: abhay_kala
  Integration of a complex function having singularities using quad amjad26 0 3,675 May-17-2019, 09:16 PM
Last Post: amjad26
  How to run python code in Java using remote SSH without py file using streams in Java varanasipavankumar 0 1,770 Apr-07-2019, 06:13 PM
Last Post: varanasipavankumar

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020