Linked Questions

16 votes
4 answers
11k views

Which is better: string html generation or jquery DOM element creation?

Ok, I'm rewriting some vanilla JS functions in my current project, and I'm at a point where there's a lot of HTML being generated for tooltips etc. My question is, is it better/preferred to do this: ...
Ed James's user avatar
  • 10.5k
5 votes
5 answers
19k views

jQuery create element initially hidden

Is there a way to create an element and have it hidden initially? I am creating an iframe but don't want it shown right away.
gdanko's user avatar
  • 1,962
2 votes
3 answers
19k views

How to pass data from razor view to controller in mvc3?

I have a model that I'm using to pass data from my view to my controller but I have some unbound from textboxes and dropdownlists. How can I pass that unbound data from my view back to my controller ...
Mariah's user avatar
  • 727
1 vote
3 answers
10k views

How to add a hidden list of IDs to a form in Javascript?

I've got a simple form in html: <form action="" method="post"> <input id="title" name="title" size="30" type="text" value=""> <input type="submit" value="Save this stuff"> &...
kramer65's user avatar
  • 52.2k
4 votes
4 answers
5k views

jquery: how to open an url in new tab with passing post data to that url

I have a php file localhost/~user/sample.php file which gets data from post method. <?php $you = $_POST["ids"]; $start= $_POST["start"]; echo $you."--".$start; I want to write a jquery code which ...
Santhosh's user avatar
  • 11k
0 votes
1 answer
3k views

Add Html helpers with Jquery (Razor)

I need to add an @Html.HiddenFor when a button is clicked My jquery code is this: function btnAdd() { var x; y = $("#drpDwnPRTPP"); $("#budgetsList ul").html('<li>Primer elemento ' + '@...
Lio's user avatar
  • 5
0 votes
3 answers
3k views

How to automatically add textbox

I have these 8 textboxes, but when I start to think that it were very messy on my page. So, I am thinking that how to implement a button which can add textbox when user click on it. Does anyone here ...
dont share's user avatar
1 vote
3 answers
1k views

Submitting a form (post, NOT ajax) with some additional parameters

I need to perform a non-ajax post by clicking the submit of a form. Before submiting I have to add some additional form parameters. Here is how I do this: $("#my_form").on("submit", function (e) { ...
Incerteza's user avatar
  • 33.6k
1 vote
2 answers
1k views

Google Analytics - Using GET instead of POST

Ran into an issue where I need to use GET vs POST on a form method, but GATC cookie data is not being appended to the URL correctly, because the form's data is trumping Google's GATC data (using ...
Mike Purcell's user avatar
  • 19.9k
0 votes
0 answers
2k views

laravel 5.4: how to pass value from javascript to controller for updating data

I am new to laravel. I want to update a database row. For this purpose, i want to pass the id of the corresponding row to the controller from javascript. I can get the id in javascript file from view. ...
Nazem Mahmud Piash's user avatar
0 votes
1 answer
801 views

Using href in jquery with get method

i´m learning jquery and i have a question. On html, when i want to pass variables by get, i write: $subject=$_GET['subject']; $id_user=$_GET['id_user']; $id_pupil=$_GET['id_pupil']; <a href='...
Alonso González Nestal's user avatar
1 vote
1 answer
338 views

How to make PHP or JavaScript spawn an HTML form

What is a way that I can make a button to spawn infinite forms? Any method would work, but I just can't think of any. This is kind of the layout I am thinking of Country | Province | Topic | ...
Ryan David Ward's user avatar
1 vote
2 answers
208 views

correct syntax for pure javascript

I have this code: function render(str) { var main = document.createElement('div'); with(main.style) { //style stuff here } main.appendChild(document.createTextNode(str))...
greenbandit's user avatar
  • 2,265
0 votes
1 answer
247 views

Spring MVC bind property

I have list box in my JSP page which is getting populated by object which is passed from controller side. I want to choose some items and press DELETE button to remove some items from my black list. (...
Wild Goat's user avatar
  • 3,519
0 votes
1 answer
47 views

Inserting non-form data into database using jQuery

I have a function in JavaScript with the following parameters below: insertdata(micheal, newyork) I want to be able to insert thus: name = micheal location = newyork into my MySQL database using ...
Nutty Hnic's user avatar