Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get value from input in model

I have a bootstrap model and inside I have an input field.

<input type="text" name="quota" class="form-control" id="quotas" value="'.$storagequota.'" maxlength="20" >

Also, I have a button which when clicked calls a function so I can get the value of the input field.

function getQuota(){
    quota = $("#quotas").val();
    alert(quota);
}

The problem is that I cannot get the value that user typed. The weird thing is that i have another model in another page that works in the same way. Can someone help with that? Thanks in advance.

like image 747
Agis Soleas Avatar asked Aug 28 '15 16:08

Agis Soleas


1 Answers

Just put the id of the modal before the id of the input

$("#registration_modal #useremail").val().trim()
like image 180
William Hammock Avatar answered Oct 02 '22 14:10

William Hammock