Python Forum
phython language java integration
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
phython language java integration
#1
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:

Output:
<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="<%= current_user.id %>" /> <input type="submit" value="Submit"/> </form>
Relevant Javascript Code:

Output:
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
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Active Directory integration dady 2 465 Oct-13-2023, 04:02 AM
Last Post: deanhystad
  Help with Integration Pandas excel - Python Gegemendes 5 1,725 Jun-05-2022, 09:46 PM
Last Post: Gegemendes
Photo Integration of apache spark and Kafka on eclipse pyspark aupres 1 3,701 Feb-27-2021, 08:38 AM
Last Post: Serafim
  issue with Tabula-py, pyinstaller and java maurom82 2 3,125 Feb-19-2021, 04:32 PM
Last Post: buran
  Tableau Time Series Prediction using Python Integration tobimarsh43 0 1,888 Jul-24-2020, 10:38 AM
Last Post: tobimarsh43
  R-PYTHON INTEGRATION RELATED PROBLEM arnab93 0 1,418 Jun-05-2020, 02:07 PM
Last Post: arnab93
  STATA/Python Integration jprender 0 1,804 May-03-2020, 09:38 PM
Last Post: jprender
  Can't install Phython Ricardo14 1 1,728 Jan-31-2020, 12:04 PM
Last Post: metulburr
  How to insert record into MySQL using Phython abhay_kala 1 2,233 Dec-06-2019, 04:34 PM
Last Post: abhay_kala
  Integration of a complex function having singularities using quad amjad26 0 5,585 May-17-2019, 09:16 PM
Last Post: amjad26

Forum Jump:

User Panel Messages

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