Jump to content

getElementById (Again)


anujgarg

Recommended Posts

Hi

 

I am repeting my question/problem in somewhat more descriptive way:

 

I have two forms having same functionality of searching with single textbox only. Both forms are using same JS functions for validation. So my problem is if I fill any of the textbox then another form creates problem (occurs validation). Also, in the second form, I have another field of dropdown which is totally dependent on form's action.

 

If I use the following code for both the forms then I face the above problem:

 

<form method="post" id="locator_full_form" action="/postdata.php" onsubmit=" fn_val_postal(document.forms[0].elements('typed_zip_field'));">

<div>
<input type="hidden" name="form_id_hidden_field" value="locator_full_form" />
</div>

<p>
Enter your 5-Digit U.S. ZIP code or the first 3 characters of your Canadian postal code:
</p>

<p>
<input id="id_input_typed_zip" type="text" name="typed_zip_field" />

<input type="image" src="/images/btn_submit.jpg" name="zip_button" value="Search by Zipcode" />
<br />
</form>

 

How can I make both the forms functioning at the same time??

 

Any help will be highly appreciated.

 

TIA

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.