Jump to content

submitting only a particulat field whene there are many fiels in a form


bindiya

Recommended Posts

So you want the complete form to be submited even with empty fields automatically as a user writes in the field or when he changes a field?

 

Either way you need to use javascript to manipulate the data on the client side. 

document.yourform.submit()

or if you want to do server side functions use ajax to send it to php file where you will handle the form data.

 

Now to actually do the abaove you need to call a function either:

onkeyup='your_javascript_function()' or onblur='your_javascript_function()'

This would have to be like:

<input type='text' name='your_field' id='your_field' onblur='your_javascript_function()' />

or

<input type='text' name='your_field' id='your_field' onkeyup='your_javascript_function()' />

 

I hope this helps

Link to comment
Share on other sites

Then on the first text field use the onblur like :

<input type='text' name='your_field' id='your_field' onblur='your_javascript_function(this.value)' />

were you see your_javascript_function(this.value) it's the function that will handle the data from that form

 

Link to comment
Share on other sites

well submit() is a reserved javascript function so its better to use another name for your function. like chk() for check. But yes that is the general idea. Also you need to have a function like

<script type="text/javascript">
function chk(username)
{
//do something here
}
</script>

in order to get the value and handle it the way you want within the function

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.