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


Messages In This Thread
phython language java integration - by jammytcs123123 - Jul-04-2018, 12:27 AM
RE: phython language java integration - by Skaperen - Jul-04-2018, 03:13 AM

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