Search Results

Search found 5274 results on 211 pages for 'submit'.

Page 32/211 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Drupal Studs help me with my form_alter hook ( I am almost there)

    - by user363036
    So I think I am almost there conceptually but need some missing pointers. Objective is to add a few more fields to the normal user registration form, style it a little, then submit it with storing the extra fields in a table. This is what I have so far. Can someone give me the final nudge and get me going. Please help me. Also how do I apply some minor styling like aligning the new form fields ? Thank you so much !!!!!!!!! function module_menu() { $items = array(); $items['school/registration'] = array( 'title' = 'Upgraded Registration Form', 'page callback' ='module_school_register', 'type' = MENU_CALLBACK ); return $items; }//end of the function function module_school_register(){ return drupal_get_form('form_school_register'); }//end of the function function module_school_form_alter(&$form, $form_state, $form_id) { dsm($form_id); if ($form_id == 'user_registration_form') { // modify the "#submit" form property by prepending another submit handler array $form['#submit'] = array_merge( array('_module_registration_submit' = array()), $form['#submit'] ); } } function _module_registration_submit($form_id, $form_values) { // store extra data in different table } function module_registration_validate($form, &$form_state) { $error=0; //Validation stuff here, set $error to true if something went wrong, or however u want to do this. Completely up to u in how u set errors. if ($error) { form_set_error('new_field_name', 'AHH SOMETHING WRONG!'); } }

    Read the article

  • Get all Select Elements in a Form by referencing $(this) instead of $("form select")

    - by DaveDev
    Hi Guys I'm currently getting all the Select elements that exist in a form with the following: $("form").submit(function(event) { // gather data var data = GetSelectData($("form select")); // do submit $.post($(this).attr("action"), data, ..etc) }); Instead of passing in $("form select"), is there a way I can say something like $(this).children('select') // this doesn't work, btw to get all the select elements that exist within the context of the form the submit event is executing for? This will allow me to reduce my code to the following, moving all the functionality into a common function: $("form").submit(function(event) { GatherDataAndSubmit($(this)); }); function GatherDataAndSubmit(obj) { var data = GetSelectData(obj.children('select')); $.post(obj.attr("action"), data, ..etc) } Thanks Dave

    Read the article

  • Passing data from a View to a controller in ASP.Net MVC

    - by kingrichard2005
    Hello, I have a dictionary I'm passing to a View. I want to be able to pass the values of that dictionary back to a Controller action from this same View. Is there anyway this can be accomplished without using a form? The situation is that I need to be able to pass these back to a controller action that is called when a user clicks an ActionLink from the View, and in my experience an ActionLink cannot be used to submit a values of a form, i.e. I've only been able to submit values of a form using the form's submit button. Unless there's a way to use an ActionLink to submit values in a form.

    Read the article

  • Can i have One form tag inside Another in ASP.net MVC RC2

    - by coolguy97
    Hi all, I am currently Developing application in MVC2 I have want to used mutiple form tags in My application In My View I have Created a table which has Delete option which i am doing through Post for Individual Delete so i have Create form tag for each button. i also want user to give option to delete mutiple records so i am providing them with checkboxes.This form should have all the values of checkboxes and all. so form gets render Like this for Each delete button <form action="/Home/MutipleDelete" method="post"> <input class="button " name="Compare" type="submit" value="Mutipledelete" style="margin-right:132px;" /> <input id="chk1" name="chk1" type="checkbox" value="true" /> <form action="/Home/Delete" method="post"> <input type="submit" class="submitLink" value="member1" /> <input type="hidden" name="hfmem1" id="hfmem1" value="1" /> </form> <input id="chk2" name="chk2" type="checkbox" value="true" /> <form action="/Home/Delete" method="post"> <input type="submit" class="submitLink" value="member2" /> <input type="hidden" name="hfmem2" id="hfmem2" value="2" /> </form> </form> The following is not working . but IF i write my code that form renders in this way <form action="/Home/MutipleDelete" method="post"> <input class="button " name="Compare" type="submit" value="Mutipledelete" style="margin-right:132px;" /> </form> <input id="chk1" name="chk1" type="checkbox" value="true" /> <form action="/Home/Delete" method="post"> <input type="submit" class="submitLink" value="member1" /> <input type="hidden" name="hfmem1" id="hfmem1" value="1" /> </form> <input id="chk2" name="chk2" type="checkbox" value="true" /> <form action="/Home/Delete" method="post"> <input type="submit" class="submitLink" value="member2" /> <input type="hidden" name="hfmem2" id="hfmem2" value="2" /> </form> it is working in Mozilla but not in IE.I have debug and Checked values in formcollection In contoller.What to do.?

    Read the article

  • How to add default value on save form?

    - by Ignacio
    I have an object Task and a form that saves it. I want to automatically asign created_by field to the currently logged in user. So, my view is this: def new_task(request, task_id=None): message = None if task_id is not None: task = Task.objects.get(pk=task_id) message = 'TaskOK' submit = 'Update' else: task = Task(created_by = GPUser(user=request.user)) submit = 'Create' if request.method == 'POST': # If the form has been submitted... form = TaskForm(request.POST, instance=task) if form.is_valid(): task = form.save(commit=False); task.created_by = GPUser(user=request.user) task.save() if message == None: message = 'taskOK' return tasks(request, message) else: form = TaskForm(instance=task) return custom_render('user/new_task.html', {'form': form, 'submit': submit, 'task_id':task.id}, request) The problem is, you guessed, the created_by field doesn't get saved. Any ideas? Thanks

    Read the article

  • Why is there a time lag when trying to change the text on a button in IE using JQuery?

    - by Deane
    I have some Ajax that runs on a button click. Sometimes it takes a few seconds to return, so I wanted a visual clue to the user that the browser was doing something. So, I have this: $('#SubmitButton').attr("value", "Working..."); $('#SubmitButton').attr("disabled", true); //Synchronous Ajax call goes here $('#SubmitButton').attr("value", "Submit"); $('#SubmitButton').attr("disabled", false); As you can see, it changes the text on the button, and disables it. When the Ajax call comes back (it's synchronous, remember), the button changes back. In Firefox, this works great. In IE, it's...odd. It doesn't run the code in order. It doesn't change the text of the button and launches right into the Ajax call. The browser blocks with the Submit active and saying "Submit." Right after the Ajax comes back, the button quickly flashes "Working..." then back to Submit." So, for some reason, IE isn't changing the text of the button until after the Ajax call, even though the code for it is before the Ajax call. It's acting like this: //Synchronous Ajax call goes here $('#SubmitButton').attr("value", "Working..."); $('#SubmitButton').attr("disabled", true); $('#SubmitButton').attr("value", "Submit"); $('#SubmitButton').attr("disabled", false); Again, this works perfectly in Firefox. But in IE, there's some kind of...lag?

    Read the article

  • How to reenable event.preventDefault?

    - by Richbits
    I have a web page which I have prevented the default action on all submit buttons, however I would like to re-enable default submit action on a button how can I do this? I am currently preventing the default action using the following: $("form").bind("submit", function(e){ e.preventDefault(); }); I have successfully done this using the following: $(document).ready(function(){ $("form:not('#press')").bind("submit", function(e){ e.preventDefault(); }); But can I do this dynamically when the button is clicked?

    Read the article

  • PHP with Javascript: Email confirmation script not working

    - by Josh K
    Hey Heres what i got: echo "<script type=\"text/javascript\"> function finishForm() { var answer = confirm('Are you sure these are the teams you want to enter with?'); if (answer) { if(document.getElementByID(emailconfirm).value == ".$_SESSION[Email].") { form.action=\"esubmit.php\"; form.submit(); } else { alert('E-mail address do not match'); return false; } } } function restartForm() { var answer = confirm('Are you sure you want to start over?'); if (answer) { form.action=\"e1.php\"; form.submit(); } } </script>"; I have a regular button calling this function. emailconfirm is a text input. I want to confirm that they have chosen the right teams, then check if the email in the session and the email confirmation text match. If they do match Then i want to submit the form. If they dont match, I want to alert the user they dont match, and just return to page so user can check emails and then resubmit. This script is in my header. EDIT: Haha sorry i submitted one before and it didnt go through, forgot to add my problem!! When you click the button it comes up with the confirmation, clicking either yes or no doesnt do anything. The alert doesnt pop up if they dont match and if they do match it doesnt submit. Also it might be good to note I had it without the email confirmation if statement and it worked fine (going to the submit page)

    Read the article

  • problem with Infopath Form services

    - by AB
    I want to have some url for my infopath form and give that link to user instead of going to form library and click new...how is it possible? Also when I created Infopath form I have given some text fields and button, I don't want the Infopath services buttons(Save,save as...) how I cna remove those? I published my form into document library. I click new and fill information and submit its working fine but when I reopen it again and try to submit it ...its giving me error...that some rules are not correct ...the rules I have on submit button are submit to document library and close after submitting.Any idea how to resolve this.... Any suggestions would really be appreciated...Thanks

    Read the article

  • Dynamically generate client-side HTML form control using JavaScript and server-side Python code in Google App Engine

    - by gisc
    I have the following client-side front-end HTML using Jinja2 template engine: {% for record in result %} <textarea name="remark">{{ record.remark }}</textarea> <input type="submit" name="approve" value="Approve" /> {% endfor %} Thus the HTML may show more than 1 set of textarea and submit button. The back-end Python code retrieves a variable number of records from a gql query using the model, and pass this to the Jinja2 template in result. When a submit button is clicked, it triggers the post method to update the record: def post(self): if self.request.get('approve'): updated_remark = self.request.get('remark') record.remark = db.Text(updated_remark) record.put() However, in some instances, the record updated is NOT the one that correspond to the submit button clicked (eg if a user clicks on record 1 submit, record 2 remark gets updated, but not record 1). I gather that this is due to the duplicate attribute name remark. I can possibly use JavaScript/jQuery to generate different attribute names. The question is, how do I code the back-end Python to get the (variable number of) names generated by the JavaScript? Thanks.

    Read the article

  • How to add default value on django save form?

    - by Ignacio
    I have an object Task and a form that saves it. I want to automatically asign created_by field to the currently logged in user. So, my view is this: def new_task(request, task_id=None): message = None if task_id is not None: task = Task.objects.get(pk=task_id) message = 'TaskOK' submit = 'Update' else: task = Task(created_by = GPUser(user=request.user)) submit = 'Create' if request.method == 'POST': # If the form has been submitted... form = TaskForm(request.POST, instance=task) if form.is_valid(): task = form.save(commit=False); task.created_by = GPUser(user=request.user) task.save() if message == None: message = 'taskOK' return tasks(request, message) else: form = TaskForm(instance=task) return custom_render('user/new_task.html', {'form': form, 'submit': submit, 'task_id':task.id}, request) The problem is, you guessed, the created_by field doesn't get saved. Any ideas? Thanks

    Read the article

  • javascript check function for a html form

    - by Reteras Remus
    I'm having a problem with a HTML form (name, e-mail, subject, message), I can't validate the form if it was completed correct or not. I want to call a javascript function when the form is submitted and alert if a field wasn't completed correct. My problem is with the submit button, because my boss said that I must use he's own php function to insert a submit button. The php function looke like: function normal_button($text, $width, $param = '', $class = 'button-blue') { $content = '<div class="'.$class.'" style="width:'.$width.'px;" '.$param.'>'.$text.'</div>'; return $content; } and how I call the function: echo normal_button('Send it', '100', 'onclick="document.getElementById(\'emailForm\').submit();" '); I tried to call the js function declaring the onSubmit="return checkForm(this)" in the <form action='email.php' method='post'> HTML form, but I can't "catch" the submit. Also I tried to catch it with jquery, $(document).ready(function() { $('.normal_button').click(function() { }); ); but I can't return false if a field wasn't completed correct. I must use he's PHP function to insert the submit button, but how can I "catch" the fields, how can I validate them? Any suggestions? Thank you !

    Read the article

  • Submitting a form from Email

    - by bubbl
    I was working on a project to submit a form from an email. The scenario is this. We will send a form to list of emails where in the customer has to fill in the form and once they hit submit, the form should be submitted and server should be able to retrieve the values that is provided by the person filling in.When i tried, it was not considering the submit button as form submit and no action is being performed. Can anyone help me to resolve this. Thanks in advance.

    Read the article

  • Using jquery ui dialog to confirm action for form submission

    - by redbluegreen
    I have multiple forms on a page, for each of them I want the user to confirm before form submission. but when the user confirms to submit, how do I let this dialog know which form the user is sumbitting? Does it take custom parameters? Thanks. $("#dialog-confirm").dialog({ resizable: false, height:140, modal: true, buttons: { 'Confirm submit': function() { document.______???????_____.submit(); }, Cancel: function() { $(this).dialog('close'); } } }); $('.allForms').submit(function(){ $('#dialog-confirm').dialog('open'); });

    Read the article

  • Why am I getting a "skipping broken view error" ?

    - by user363036
    This is Drupal 6.x and am having a nightmare of a time to modify a simple drupal form. This is a module file. function modulename_menu() { $items = array(); $items['school/registration'] = array( 'title' = 'Registration Form', 'page callback' ='drupal_get_form', 'type' = MENU_CALLBACK ); return $items; }//end of the function function modulename_school_form_alter(&$form, $form_state, $form_id) { // dsm($form_id); if ($form_id == 'user_registration_form') { // modify the "#submit" form property by prepending another submit handler arra $form['#submit'] = array_merge( array('_modulename_registration_submit' = array()), $form['#submit'] ); } }

    Read the article

  • JQuery SimpleModal

    - by Matt
    I've got a submit button inside my modal, and when it's pressed nothing happens! How do I make my form submit when the push my submit button? I don't want to use $('form').submit(); because then php doesn't detect that my button was clicked. <script type="text/javascript" language="javascript"> $(document).ready(function () { $('#btnAdd').click(function (e) { //clicking the button shows the modal popup up e.preventDefault(); $('#AddCareerItem').modal(); }); $('#btnCancelCareerContent').click(function (e) { //close the modal with the cancel button $.modal.close(); }); }); </script>

    Read the article

  • [Apache] Creating rewrite rules for multiple urls in the same folder

    - by DavidYell
    I have been asked by our client to convert a site we created into SEO friendly url format. I've managed to crack a small way into this, but have hit a problem with having the same urls in the same folder. I am trying to rewrite the following urls, /review/index.php?cid=intercasino /review/submit.php?cid=intercasino /review/index.php?cid=intercasino&page=2#reviews I would like to get them to, /review/intercasino /submit-review/intercasino /review/intercasino/2#reviews I've almost got it working using the following rule, RewriteRule (submit-review)/(.*)$ review/submit.php?cid=$2 [L] RewriteRule (^review)/(.*) review/index.php?cid=$2 The problem, you may already see, is that /submit-review rewrites to /review, which in turn gets rewritten to index.php, thus my review submission page is lost in place of my index page. I figured that putting [L] would prevent the second rule being called, but it seems that it rewrites both urls in two seperate passes. I've also tried [QSE], and [S=1] I would rather not have to move my files into different folders to get the rewriting to work, as that just seems too much like bad practise. If anyone could give me some pointers on how to differentiate between these similar urls that would be great! Thanks (Ref: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html)

    Read the article

  • need to run php script when form is submitted

    - by Brad
    I have a form that needs to run a php script once the submit button is clicked, it needs to be ajax. <form method="post" action="index.php" id="entryform" name="entryform"> <input type="submit" name="submit" value="Submit" onclick="JavaScript:xmlhttpPost('/web/ee_web/include/email-notification.php', 'entryform')" /> </form> In this situation, using if(form posted) { get results and run script } is not an option, I need to run the script externally, that is why I need it to execute the email-notification.php at onclick When I point my web browser to domain.com/include/email-notification.php - it runs perfectly. Any help is appreciated.

    Read the article

  • Time Calculation in Python

    - by user343934
    Hi everyone, I have two python cgi pages (index, display), what i need to do is calculate time frame between the execution. Work flow: Index.py (submit) After submit it redirect to display.py page display.py page has got class with execute(),display() &init_main() functions In init_main() i have created class object which access to above functions I need to calculate time interval between the submit (index.py) to execute() end, so i can show user how much time does different weighted file takes on real time. Hoping to see your suggestions Thanks

    Read the article

  • Change URL Submitted to Depending on Form Selection

    - by Chris
    I have a form which I need to submit to one of three different URLs depending on a selection made in the form. I suspect the easiest solution is to use jQuery to insert the appropriate path before the rest of the form parameters as the selection is made, but not sure on what the code would be. Any pointers greratly appreciated! <form id="myForm" action='/booking/default-path' accept-charset='utf-8' method='get'> <select name="paramA" id="paramA"> <option id="optionA" value="A" selected="selected">Option A</option> <option id="optionB" value="B">Option B</option> </select> <select name="currency" id="currency"> <option id="GBP" value="GBP" selected="selected">British Pounds</option> <option id="EUR" value="EUR">Euros</option> <option id="USD" value="USD">US Dollars</option> </select> <input type="submit" value="submit" id="submit" name="submit" /> </form> Where the three different URLs would be: ../booking/default-path-gbp?...[params here]... ../booking/default-path-eur?...[params here]... ../booking/default-path-usd?...[params here]... I know it would be a lot easier to incorporate the parameter in the usual way and just use one submission URL root, but unfortunately I'm submitting to an eComms system out of my control and am stuck with having to find a solution to this. Should be easy I think, but not sure where to start, jQuery used elsewhere, so would prefer to use this framework in any solutions.

    Read the article

  • uploading different types of files mostly pdfs

    - by Anders Kitson
    I would like to upload different types of files pressumably pdfs to a certain directory I am currently trying to get this one script working that I found on snipplr but it is not working as I assumed it would, here is my code. <?php if( isset($_POST['submit']) ) { $target_path = "../downloads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name'])." has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data"> <input type="file"> <input type="submit" name="submit" value="submit" /> </form>

    Read the article

  • Firefox is occasionally breaking the back button.

    - by Webjedi
    Having a really frustrating time with Firefox and the back button...given this simple ASP form: <head> <title>Form 1</title> </head> <body> <form action="form2.asp" method="post"> Enter some text:<input type="text" name="thetext" id="thetext"> <input type="submit" id="submit" name="submit"> </form> </body> </html> Firefox (3.6.3) will occasionally clear the value of the text box after hitting submit and then the back button. It's unpredictable when it will strike. And it will work for dozens to hundreds of times, and then all of a sudden it stops working. Any ideas where I should start?

    Read the article

  • Prevent empty form input array from being posted?

    - by user355295
    Sorry if this has been answered somewhere; I'm not quite sure how to phrase the problem to even look for help. Anyway, I have a form with three text input boxes, where the user will input three song titles. I have simple PHP set up to treat those input boxes as an array (because I may want, say, 100 song titles in the future) and write the song titles to another document. <form method="post"> <input type="text" name="songs[]" value="" /> <input type="text" name="songs[]" value="" /> <input type="text" name="songs[]" value="" /> <button type="submit" name="submit" value="submit">Submit</button> </form> <?php if (isset($_POST['submit'])) { $open = fopen("test.html", "w"); if(empty($_POST['songs'])) { } else { $songs = $_POST['songs']; foreach($songs as $song) { fwrite($open, $song."<br />"); }; }; }; ?> This correctly writes the song titles to an external file. However, even when the input boxes are empty, the external file will still be written to (just with the <br />'s). I'd assumed that the if statement would ensure nothing would happen if the boxes were blank, but that's obviously not the case. I guess the array's not really empty like I thought it was, but I'm not really sure what implications that comes with. Any idea what I'm doing wrong? (And again, I am clueless when it comes to PHP, so forgive me if this has been answered a million times before, if I described it horribly, etc.)

    Read the article

  • Onclick not added until after Postback

    - by Morph
    I have the following: <asp:Button id="SubmitButton" Text="Submit" runat="server" OnClientClick="Do();" OnClick="SubmitButton_Click"/> When the page is first rendered, I go to the view source in my browser and see that the onclick="Do();" is not added to my submit button tag. But when I do a post back, and do the view source again, the onclick is added to the submit. Why would the onclick not be there on the first request?

    Read the article

  • Displaying validation control in a div tag

    - by JaiGanesh
    I have a div tag for which i have defined a border. i have given the validation control inside the div tag Now before clicking the "submit" i get to see the div tag and border. - how to avoid this Now after clicking the "submit" i get to see the div tag and border- which is exptected and correct. My question how to hide the border in the div tag before clicking the "submit" button or on the click of the "cancel" button

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >